-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.xaml
289 lines (289 loc) · 20.9 KB
/
Main.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<Activity mc:Ignorable="sap sap2010" x:Class="Main" sap2010:Annotation.AnnotationText="UPTF00000088eyI8SGVscExpbms+a19fQmFja2luZ0ZpZWxkIjpudWxsLCI8SW5pdGlhbFRvb2x0aXA+a19fQmFja2luZ0ZpZWxkIjpudWxsLCI8VmVyc2lvbj5rX19CYWNraW5nRmllbGQiOjF9" sap2010:ExpressionActivityEditor.ExpressionActivityEditor="C#" sap:VirtualizedContainerService.HintSize="740,2523" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:sc="clr-namespace:System.Collections;assembly=System.Private.CoreLib" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Text</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>GlobalConstantsNamespace</x:String>
<x:String>System.Linq.Expressions</x:String>
<x:String>System.Runtime.Serialization</x:String>
<x:String>System.Reflection</x:String>
<x:String>System.Numerics</x:String>
<x:String>UiPath.Activities.System.Collections</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.CSharp</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.Collections</AssemblyReference>
<AssemblyReference>System.Collections.Immutable</AssemblyReference>
<AssemblyReference>System.Collections.NonGeneric</AssemblyReference>
<AssemblyReference>System.ComponentModel</AssemblyReference>
<AssemblyReference>System.ComponentModel.TypeConverter</AssemblyReference>
<AssemblyReference>System.Configuration.ConfigurationManager</AssemblyReference>
<AssemblyReference>System.Console</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.Common</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Drawing.Common</AssemblyReference>
<AssemblyReference>System.Drawing.Primitives</AssemblyReference>
<AssemblyReference>System.Linq</AssemblyReference>
<AssemblyReference>System.Linq.Async</AssemblyReference>
<AssemblyReference>System.Linq.Expressions</AssemblyReference>
<AssemblyReference>System.Linq.Parallel</AssemblyReference>
<AssemblyReference>System.Linq.Queryable</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>System.Net.Mail</AssemblyReference>
<AssemblyReference>System.ObjectModel</AssemblyReference>
<AssemblyReference>System.Private.CoreLib</AssemblyReference>
<AssemblyReference>System.Private.DataContractSerialization</AssemblyReference>
<AssemblyReference>System.Private.ServiceModel</AssemblyReference>
<AssemblyReference>System.Private.Uri</AssemblyReference>
<AssemblyReference>System.Reflection.DispatchProxy</AssemblyReference>
<AssemblyReference>System.Reflection.Metadata</AssemblyReference>
<AssemblyReference>System.Reflection.TypeExtensions</AssemblyReference>
<AssemblyReference>System.Runtime.Numerics</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Formatters</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Primitives</AssemblyReference>
<AssemblyReference>System.Security.Permissions</AssemblyReference>
<AssemblyReference>System.ServiceModel</AssemblyReference>
<AssemblyReference>System.ServiceModel.Activities</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.Studio.Constants</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>UiPath.Workflow</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence DisplayName="Main Sequence" sap:VirtualizedContainerService.HintSize="750,2458" sap2010:WorkflowViewState.IdRef="Sequence_1">
<Sequence.Variables>
<Variable x:TypeArguments="scg:Dictionary(x:Int32, x:String)" Name="dictInput">
<Variable.Default>
<CSharpValue x:TypeArguments="scg:Dictionary(x:Int32, x:String)" sap2010:WorkflowViewState.IdRef="CSharpValue`1_5">new Dictionary<Int32, string>()</CSharpValue>
</Variable.Default>
</Variable>
<Variable x:TypeArguments="scg:Dictionary(x:String, x:Int32)" Name="dictReport">
<Variable.Default>
<CSharpValue x:TypeArguments="scg:Dictionary(x:String, x:Int32)" sap2010:WorkflowViewState.IdRef="CSharpValue`1_8">new Dictionary<string, Int32>()</CSharpValue>
</Variable.Default>
</Variable>
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:LogMessage DisplayName="Log Message RPADev-S03P03-Dictionaries-Integers.Main.Begin;" sap:VirtualizedContainerService.HintSize="688,173" sap2010:WorkflowViewState.IdRef="LogMessage_1">
<ui:LogMessage.Level>
<InArgument x:TypeArguments="ui:LogLevel">
<CSharpValue x:TypeArguments="ui:LogLevel" sap2010:WorkflowViewState.IdRef="CSharpValue`1_2">UiPath.Core.Activities.LogLevel.Info</CSharpValue>
</InArgument>
</ui:LogMessage.Level>
<ui:LogMessage.Message>
<InArgument x:TypeArguments="x:Object">
<CSharpValue x:TypeArguments="x:Object" sap2010:WorkflowViewState.IdRef="CSharpValue`1_1">"RPADev-S03P03-Dictionaries-Integers.Main.Begin;"</CSharpValue>
</InArgument>
</ui:LogMessage.Message>
</ui:LogMessage>
<Sequence sap2010:Annotation.AnnotationText="Calculate and print the number of victories of each Tour de France winner

Given an input dictionary containing a year and a name, please calculate the number of victories of each winner and print all the names of the winners with the number of corresponding victories.

Note: Initialize a dictionary of type (Int32, String) with the following value - New Dictionary(Of Int32,String) From {{2006, "Oscar Pereiro"}, {2007, "Alberto Contador"}, {2008, "Carlos Sastre"}, {2009, "Alberto Contador"}, {2010, "Andy Schleck"}, {2011, "Cadel Evans"}, {2012, "Bradley Wiggins"}, {2013, "Chris Froome"}, {2014, "Vincenzo Nibali"}, {2015, "Chris Froome"}, {2016, "Chris Froome"}, {2017, "Chris Froome"}, {2018, "Geraint Thomas"}}" DisplayName="Sequence Initialization" sap:VirtualizedContainerService.HintSize="688,498" sap2010:WorkflowViewState.IdRef="Sequence_2">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:MultipleAssign sap2010:Annotation.AnnotationText="Instantiate the dictionaries." DisplayName="Multiple Assign Initialization" sap:VirtualizedContainerService.HintSize="479,201" sap2010:WorkflowViewState.IdRef="MultipleAssign_1">
<ui:MultipleAssign.AssignOperations>
<scg:List x:TypeArguments="ui:AssignOperation" Capacity="4">
<ui:AssignOperation sap2010:WorkflowViewState.IdRef="AssignOperation_1">
<ui:AssignOperation.To>
<OutArgument x:TypeArguments="scg:Dictionary(x:Int32, x:String)">
<CSharpReference x:TypeArguments="scg:Dictionary(x:Int32, x:String)" sap2010:WorkflowViewState.IdRef="CSharpReference`1_1">dictInput</CSharpReference>
</OutArgument>
</ui:AssignOperation.To>
<ui:AssignOperation.Value>
<InArgument x:TypeArguments="scg:Dictionary(x:Int32, x:String)">
<CSharpValue x:TypeArguments="scg:Dictionary(x:Int32, x:String)" sap2010:WorkflowViewState.IdRef="CSharpValue`1_7">new Dictionary<Int32, string>() {{2006, "Oscar Pereiro"}, {2007, "Alberto Contador"}, {2008, "Carlos Sastre"}, {2009, "Alberto Contador"}, {2010, "Andy Schleck"}, {2011, "Cadel Evans"}, {2012, "Bradley Wiggins"}, {2013, "Chris Froome"}, {2014, "Vincenzo Nibali"}, {2015, "Chris Froome"}, {2016, "Chris Froome"}, {2017, "Chris Froome"}, {2018, "Geraint Thomas"}}</CSharpValue>
</InArgument>
</ui:AssignOperation.Value>
</ui:AssignOperation>
<ui:AssignOperation sap2010:WorkflowViewState.IdRef="AssignOperation_2">
<ui:AssignOperation.To>
<OutArgument x:TypeArguments="scg:Dictionary(x:String, x:Int32)">
<CSharpReference x:TypeArguments="scg:Dictionary(x:String, x:Int32)" sap2010:WorkflowViewState.IdRef="CSharpReference`1_2">dictReport</CSharpReference>
</OutArgument>
</ui:AssignOperation.To>
<ui:AssignOperation.Value>
<InArgument x:TypeArguments="scg:Dictionary(x:String, x:Int32)">
<CSharpValue x:TypeArguments="scg:Dictionary(x:String, x:Int32)" sap2010:WorkflowViewState.IdRef="CSharpValue`1_9">new Dictionary<string, Int32>()</CSharpValue>
</InArgument>
</ui:AssignOperation.Value>
</ui:AssignOperation>
</scg:List>
</ui:MultipleAssign.AssignOperations>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</ui:MultipleAssign>
</Sequence>
<Sequence sap2010:Annotation.AnnotationText="dictInput<Int32, String> = Year, Name
dictReport<String, Int32> = Name, VictoryCount" DisplayName="Sequence Operation" sap:VirtualizedContainerService.HintSize="688,1121" sap2010:WorkflowViewState.IdRef="Sequence_3">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:ForEach x:TypeArguments="scg:KeyValuePair(x:Int32, x:String)" CurrentIndex="{x:Null}" DisplayName="For Each Input Item" sap:VirtualizedContainerService.HintSize="626,951" sap2010:WorkflowViewState.IdRef="ForEach`1_1">
<ui:ForEach.Body>
<ActivityAction x:TypeArguments="scg:KeyValuePair(x:Int32, x:String)">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="scg:KeyValuePair(x:Int32, x:String)" Name="currentKeyValuePairOfNumberAndText" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="592,764" sap2010:WorkflowViewState.IdRef="Sequence_5">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<If DisplayName="If Validate Name" sap:VirtualizedContainerService.HintSize="530,679" sap2010:WorkflowViewState.IdRef="If_1">
<If.Condition>
<InArgument x:TypeArguments="x:Boolean">
<CSharpValue x:TypeArguments="x:Boolean" sap2010:WorkflowViewState.IdRef="CSharpValue`1_12">dictReport.ContainsKey(currentKeyValuePairOfNumberAndText.Value)</CSharpValue>
</InArgument>
</If.Condition>
<If.Then>
<Sequence sap2010:Annotation.AnnotationText="The report dictionary already contains the name as the key so increment the victory count." DisplayName="Then" sap:VirtualizedContainerService.HintSize="496,232" sap2010:WorkflowViewState.IdRef="Sequence_6">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign DisplayName="Assign Victory++" sap:VirtualizedContainerService.HintSize="434,105" sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="x:Int32">
<CSharpReference x:TypeArguments="x:Int32" sap2010:WorkflowViewState.IdRef="CSharpReference`1_4">dictReport[currentKeyValuePairOfNumberAndText.Value]</CSharpReference>
</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Int32">
<CSharpValue x:TypeArguments="x:Int32" sap2010:WorkflowViewState.IdRef="CSharpValue`1_13">dictReport[currentKeyValuePairOfNumberAndText.Value] + 1</CSharpValue>
</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</If.Then>
<If.Else>
<Sequence sap2010:Annotation.AnnotationText="The report dictionary does not contain the key so it needs to be added as 1." DisplayName="Else" sap:VirtualizedContainerService.HintSize="416,286" sap2010:WorkflowViewState.IdRef="Sequence_7">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsAnnotationDocked">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<InvokeMethod DisplayName="Invoke Method Report Key" sap:VirtualizedContainerService.HintSize="354,159" sap2010:WorkflowViewState.IdRef="InvokeMethod_1" MethodName="Add">
<InvokeMethod.TargetObject>
<InArgument x:TypeArguments="scg:Dictionary(x:String, x:Int32)">
<CSharpValue x:TypeArguments="scg:Dictionary(x:String, x:Int32)" sap2010:WorkflowViewState.IdRef="CSharpValue`1_15">dictReport</CSharpValue>
</InArgument>
</InvokeMethod.TargetObject>
<InArgument x:TypeArguments="x:String">
<CSharpValue x:TypeArguments="x:String" sap2010:WorkflowViewState.IdRef="CSharpValue`1_14">currentKeyValuePairOfNumberAndText.Value</CSharpValue>
</InArgument>
<InArgument x:TypeArguments="x:Int32">1</InArgument>
</InvokeMethod>
</Sequence>
</If.Else>
</If>
</Sequence>
</ActivityAction>
</ui:ForEach.Body>
<ui:ForEach.Values>
<InArgument x:TypeArguments="sc:IEnumerable">
<CSharpValue x:TypeArguments="sc:IEnumerable" sap2010:WorkflowViewState.IdRef="CSharpValue`1_10">dictInput</CSharpValue>
</InArgument>
</ui:ForEach.Values>
</ui:ForEach>
</Sequence>
<Sequence DisplayName="Sequence Result" sap:VirtualizedContainerService.HintSize="688,414" sap2010:WorkflowViewState.IdRef="Sequence_4">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign DisplayName="Assign Sort By Value" sap:VirtualizedContainerService.HintSize="434,122" sap2010:WorkflowViewState.IdRef="Assign_3">
<Assign.To>
<OutArgument x:TypeArguments="scg:Dictionary(x:String, x:Int32)">
<CSharpReference x:TypeArguments="scg:Dictionary(x:String, x:Int32)" sap2010:WorkflowViewState.IdRef="CSharpReference`1_6">dictReport</CSharpReference>
</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="scg:Dictionary(x:String, x:Int32)">
<CSharpValue x:TypeArguments="scg:Dictionary(x:String, x:Int32)" sap2010:WorkflowViewState.IdRef="CSharpValue`1_20">dictReport.AsEnumerable().OrderByDescending(x => x.Value).ToDictionary(x => x.Key, x => x.Value)</CSharpValue>
</InArgument>
</Assign.Value>
</Assign>
<ui:LogMessage DisplayName="Log Message RPADev-S03P03-Dictionaries-Integers.Main.Print;" sap:VirtualizedContainerService.HintSize="434,164" sap2010:WorkflowViewState.IdRef="LogMessage_3">
<ui:LogMessage.Level>
<InArgument x:TypeArguments="ui:LogLevel">
<CSharpValue x:TypeArguments="ui:LogLevel" sap2010:WorkflowViewState.IdRef="CSharpValue`1_17">UiPath.Core.Activities.LogLevel.Info</CSharpValue>
</InArgument>
</ui:LogMessage.Level>
<ui:LogMessage.Message>
<InArgument x:TypeArguments="x:Object">
<CSharpValue x:TypeArguments="x:Object" sap2010:WorkflowViewState.IdRef="CSharpValue`1_21" xml:space="preserve">"RPADev-S03P03-Dictionaries-Integers.Main.Print;" + Environment.NewLine +
string.Join(Environment.NewLine, dictReport)</CSharpValue>
</InArgument>
</ui:LogMessage.Message>
</ui:LogMessage>
</Sequence>
<ui:LogMessage DisplayName="Log Message RPADev-S03P03-Dictionaries-Integers.Main.End;" sap:VirtualizedContainerService.HintSize="688,164" sap2010:WorkflowViewState.IdRef="LogMessage_2">
<ui:LogMessage.Level>
<InArgument x:TypeArguments="ui:LogLevel">
<CSharpValue x:TypeArguments="ui:LogLevel" sap2010:WorkflowViewState.IdRef="CSharpValue`1_4">UiPath.Core.Activities.LogLevel.Info</CSharpValue>
</InArgument>
</ui:LogMessage.Level>
<ui:LogMessage.Message>
<InArgument x:TypeArguments="x:Object">
<CSharpValue x:TypeArguments="x:Object" sap2010:WorkflowViewState.IdRef="CSharpValue`1_3">"RPADev-S03P03-Dictionaries-Integers.Main.End;"</CSharpValue>
</InArgument>
</ui:LogMessage.Message>
</ui:LogMessage>
</Sequence>
</Activity>