1 //----------------------------------------------------------------
2 // <copyright company="Microsoft Corporation">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
5 //----------------------------------------------------------------
7 namespace System.Activities.Presentation
10 using System.Collections.Generic;
11 using System.Diagnostics.CodeAnalysis;
12 using System.Globalization;
15 using System.Threading.Tasks;
17 using System.Windows.Controls;
18 using System.Windows.Media;
19 using System.Windows.Media.Imaging;
22 /// Exposes members representing an icon for a workflow out-of-box items.
24 public static class WorkflowDesignerIcons
26 private static string addToCollectionIconName = "AddToCollectionIcon";
27 private static string annotationIndicatorIconName = "AnnotationIndicatorBrush";
28 private static string assignIconName = "AssignIcon";
29 private static string cancellationScopeIconName = "CancellationScopeIcon";
30 private static string clearCollectionIconName = "ClearCollectionIcon";
31 private static string compensableActivityIconName = "CompensableActivityIcon";
32 private static string compensateIconName = "CompensateIcon";
33 private static string confirmIconName = "ConfirmIcon";
34 private static string correlationScopeIconName = "CorrelationScopeIcon";
35 private static string delayIconName = "DelayIcon";
36 private static string deleteIconName = "DeleteIcon";
37 private static string deleteDisabledIconName = "DeleteDisabledIcon";
38 private static string doWhileIconName = "DoWhileIcon";
39 private static string entryIconName = "EntryIcon";
40 private static string errorValidationIconName = "ErrorValidationIcon";
41 private static string existsInCollectionIconName = "ExistsInCollectionIcon";
42 private static string exitIconName = "ExitIcon";
43 private static string extensionWindowHeaderCloseButtonName = "ExtensionWindowHeaderCloseButton";
44 private static string finalStateIconName = "FinalStateIcon";
45 private static string fitToScreenIconName = "FitToScreenIcon";
46 private static string flowchartIconName = "FlowchartIcon";
47 private static string flowDecisionIconName = "FlowDecisionIcon";
48 private static string flowDecisionIconBrushName = "FlowDecisionIconBrush";
49 private static string flowSwitchIconName = "FlowSwitchIcon";
50 private static string flowSwitchIconBrushName = "FlowSwitchIconBrush";
51 private static string forEachIconName = "ForEachIcon";
52 private static string genericLeafActivityIconName = "GenericLeafActivityIcon";
53 private static string ifIconName = "IfIcon";
54 private static string initializeCorrelationIconName = "InitializeCorrelationIcon";
55 private static string interopIconName = "InteropIcon";
56 private static string invokeDelegateIconName = "InvokeDelegateIcon";
57 private static string invokeMethodIconName = "InvokeMethodIcon";
58 private static string minimapIconName = "MinimapIcon";
59 private static string moveDownIconName = "MoveDownIcon";
60 private static string moveDownDisabledIconName = "MoveDownDisabledIcon";
61 private static string moveUpIconName = "MoveUpIcon";
62 private static string moveUpDisabledIconName = "MoveUpDisabledIcon";
63 private static string noPersistScopeIconName = "NoPersistScopeIcon";
64 private static string operationCopyIconName = "OperationCopyIcon";
65 private static string operationCopyDisabledIconName = "OperationCopyDisabledIcon";
66 private static string operationCutIconName = "OperationCutIcon";
67 private static string operationCutDisabledIconName = "OperationCutDisabledIcon";
68 private static string operationDeleteIconName = "OperationDeleteIcon";
69 private static string operationDeleteDisabledIconName = "OperationDeleteDisabledIcon";
70 private static string operationPasteIconName = "OperationPasteIcon";
71 private static string operationPasteDisabledIconName = "OperationPasteDisabledIcon";
72 private static string panModeIconName = "PanModeIcon";
73 private static string parallelForEachIconName = "ParallelForEachIcon";
74 private static string parallelIconName = "ParallelIcon";
75 private static string persistIconName = "PersistIcon";
76 private static string pickBranchIconName = "PickBranchIcon";
77 private static string pickIconName = "PickIcon";
78 private static string receiveAndSendReplyIconName = "ReceiveAndSendReplyIcon";
79 private static string receiveIconName = "ReceiveIcon";
80 private static string receiveReplyIconName = "ReceiveReplyIcon";
81 private static string removeFromCollectionIconName = "RemoveFromCollectionIcon";
82 private static string resizeGripIconName = "ResizeGripIcon";
83 private static string rethrowIconName = "RethrowIcon";
84 private static string sendAndReceiveReplyIconName = "SendAndReceiveReplyIcon";
85 private static string sendIconName = "SendIcon";
86 private static string sendReplyIconName = "SendReplyIcon";
87 private static string sequenceIconName = "SequenceIcon";
88 private static string startSymbolIconName = "StartSymbolIconBrush";
89 private static string stateIconName = "StateIcon";
90 private static string stateMachineIconName = "StateMachineIcon";
91 private static string switchIconName = "SwitchIcon";
92 private static string terminateWorkflowIconName = "TerminateWorkflowIcon";
93 private static string textBoxErrorIconName = "TextBoxErrorIcon";
94 private static string throwIconName = "ThrowIcon";
95 private static string toolboxDefaultCustomActivityName = "ToolboxDefaultCustomActivityIcon";
96 private static string transactedReceiveScopeIconName = "TransactedReceiveScopeIcon";
97 private static string transactionScopeIconName = "TransactionScopeIcon";
98 private static string transitionIconName = "TransitionIcon";
99 private static string tryCatchIconName = "TryCatchIcon";
100 private static string validationErrorIconName = "ValidationErrorIcon";
101 private static string warningValidationIconName = "WarningValidationIcon";
102 private static string whileIconName = "WhileIcon";
103 private static string writeLineIconName = "WriteLineIcon";
104 private static string zoomIconName = "ZoomIcon";
106 private static ResourceDictionary iconResourceDictionary;
108 internal static ResourceDictionary IconResourceDictionary
112 if (WorkflowDesignerIcons.iconResourceDictionary == null)
114 InitializeDefaultResourceDictionary();
117 return WorkflowDesignerIcons.iconResourceDictionary;
121 internal static bool IsDefaultCutomActivitySetByUser { get; set; }
124 /// Applies the WindowsApp style icons to all workflow out-of-box items.
126 public static void UseWindowsStoreAppStyleIcons()
128 Uri resourceUri = new Uri(string.Concat(typeof(WorkflowDesignerIcons).Assembly.GetName().Name, @";component/Themes/Icons.WindowsApp.xaml"), UriKind.RelativeOrAbsolute);
129 ResourceDictionary windowsAppIcons = (ResourceDictionary)Application.LoadComponent(resourceUri);
131 if (WorkflowDesignerIcons.iconResourceDictionary == null)
133 WorkflowDesignerIcons.iconResourceDictionary = new ResourceDictionary();
136 foreach (string key in windowsAppIcons.Keys)
138 WorkflowDesignerIcons.iconResourceDictionary[key] = windowsAppIcons[key];
141 ImageSource enabledImagaSource = null;
142 ImageSource disabledImagaSource = null;
144 WorkflowDesignerIcons.LoadImageSourceFromResource("Copy.WindowsApp", out enabledImagaSource, out disabledImagaSource);
145 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
146 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
148 WorkflowDesignerIcons.LoadImageSourceFromResource("Cut.WindowsApp", out enabledImagaSource, out disabledImagaSource);
149 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
150 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
152 WorkflowDesignerIcons.LoadImageSourceFromResource("Delete.WindowsApp", out enabledImagaSource, out disabledImagaSource);
153 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
154 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
156 WorkflowDesignerIcons.LoadImageSourceFromResource("Paste.WindowsApp", out enabledImagaSource, out disabledImagaSource);
157 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
158 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
160 // reset the flag so that we display the toolbox default custom activity icons in toolbox.
161 WorkflowDesignerIcons.IsDefaultCutomActivitySetByUser = false;
164 private static void InitializeDefaultResourceDictionary()
166 Uri resourceUri = new Uri(string.Concat(typeof(WorkflowDesignerIcons).Assembly.GetName().Name, @";component/Themes/Icons.Default.xaml"), UriKind.RelativeOrAbsolute);
167 ResourceDictionary defaultIcons = (ResourceDictionary)Application.LoadComponent(resourceUri);
169 WorkflowDesignerIcons.iconResourceDictionary = new ResourceDictionary();
171 foreach (object key in defaultIcons.Keys)
173 WorkflowDesignerIcons.iconResourceDictionary[key] = defaultIcons[key];
176 ImageSource enabledImagaSource = null;
177 ImageSource disabledImagaSource = null;
179 WorkflowDesignerIcons.LoadImageSourceFromResource("Copy.Default", out enabledImagaSource, out disabledImagaSource);
180 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
181 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
183 WorkflowDesignerIcons.LoadImageSourceFromResource("Cut.Default", out enabledImagaSource, out disabledImagaSource);
184 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
185 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
187 WorkflowDesignerIcons.LoadImageSourceFromResource("Delete.Default", out enabledImagaSource, out disabledImagaSource);
188 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
189 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
191 WorkflowDesignerIcons.LoadImageSourceFromResource("Paste.Default", out enabledImagaSource, out disabledImagaSource);
192 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] = WorkflowDesignerIcons.MakeIcon(enabledImagaSource);
193 WorkflowDesignerIcons.iconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] = WorkflowDesignerIcons.MakeIcon(disabledImagaSource);
196 private static void LoadImageSourceFromResource(string iconName, out ImageSource enabledImageSource, out ImageSource disabledImageSource)
198 string uri = string.Format(CultureInfo.InvariantCulture, "pack://application:,,,/System.Activities.Presentation;component/Resources/{0}.png", iconName);
199 BitmapImage image = new BitmapImage(new Uri(uri, UriKind.Absolute));
200 PixelFormat format = PixelFormats.Bgra32;
201 int width = image.PixelWidth;
202 int height = image.PixelHeight;
203 int stride = ((width * format.BitsPerPixel) + 7) / 8;
204 uint[] pixels = new uint[stride * height];
206 image.CopyPixels(pixels, stride, 0);
208 enabledImageSource = BitmapSource.Create(width, height, image.DpiX, image.DpiY, format, null, pixels, stride);
210 for (int i = 0; i < pixels.Length; ++i)
212 pixels[i] = WorkflowDesignerIcons.MakePixelGray(pixels[i]);
215 disabledImageSource = BitmapSource.Create(width, height, image.DpiX, image.DpiY, format, null, pixels, stride);
218 private static DrawingBrush MakeIcon(ImageSource imageSource)
220 DrawingBrush icon = new DrawingBrush();
221 icon.Stretch = Stretch.Uniform;
222 icon.Drawing = new ImageDrawing(imageSource, new Rect(new Size(16, 16)));
226 private static uint MakePixelGray(uint pixel)
228 byte blue = (byte)pixel;
229 byte green = (byte)(pixel >> 8);
230 byte red = (byte)(pixel >> 16);
231 byte alpha = (byte)(pixel >> 24);
233 byte gray = (byte)(((red * 77) + (green * 150) + (blue * 29) + 128) / 256);
234 return (uint)(alpha << 24 | gray << 16 | gray << 8 | gray);
238 /// Exposes members representing an icon associating with workflow out-of-box activities.
239 /// These icons can be found in the toolbox and/or in the workflow designer.
241 [SuppressMessage("Microsoft.Design", "CA1034", Justification = "This is what our design is.")]
242 [SuppressMessage("Microsoft.Naming", "CA1724", Justification = "This is what our design is.")]
243 public static class Activities
246 /// Gets or sets the icon for AddToCollection activity.
248 public static DrawingBrush AddToCollection
252 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.addToCollectionIconName] as DrawingBrush;
257 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.addToCollectionIconName] = value;
262 /// Gets or sets the icon for Assign activity.
264 public static DrawingBrush Assign
268 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.assignIconName] as DrawingBrush;
273 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.assignIconName] = value;
278 /// Gets or sets the icon for CancellationScope activity.
280 public static DrawingBrush CancellationScope
284 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.cancellationScopeIconName] as DrawingBrush;
289 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.cancellationScopeIconName] = value;
294 /// Gets or sets the icon for ClearCollection activity.
296 public static DrawingBrush ClearCollection
300 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.clearCollectionIconName] as DrawingBrush;
305 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.clearCollectionIconName] = value;
310 /// Gets or sets the icon for CompensableActivity activity.
312 public static DrawingBrush CompensableActivity
316 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensableActivityIconName] as DrawingBrush;
321 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensableActivityIconName] = value;
326 /// Gets or sets the icon for Compensate activity.
328 public static DrawingBrush Compensate
332 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensateIconName] as DrawingBrush;
337 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.compensateIconName] = value;
342 /// Gets or sets the icon for Confirm activity.
344 public static DrawingBrush Confirm
348 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.confirmIconName] as DrawingBrush;
353 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.confirmIconName] = value;
358 /// Gets or sets the icon for CorrelationScope activity.
360 public static DrawingBrush CorrelationScope
364 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.correlationScopeIconName] as DrawingBrush;
369 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.correlationScopeIconName] = value;
374 /// Gets or sets the icon for Delay activity.
376 public static DrawingBrush Delay
380 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.delayIconName] as DrawingBrush;
385 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.delayIconName] = value;
390 /// Gets or sets the icon for DoWhile activity.
392 public static DrawingBrush DoWhile
396 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.doWhileIconName] as DrawingBrush;
401 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.doWhileIconName] = value;
406 /// Gets or sets the icon for ExistsInCollection activity.
408 public static DrawingBrush ExistsInCollection
412 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.existsInCollectionIconName] as DrawingBrush;
417 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.existsInCollectionIconName] = value;
422 /// Gets or sets the icon for FinalState.
424 public static DrawingBrush FinalState
428 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.finalStateIconName] as DrawingBrush;
433 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.finalStateIconName] = value;
438 /// Gets or sets the icon for Flowchart.
440 public static DrawingBrush Flowchart
444 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowchartIconName] as DrawingBrush;
449 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowchartIconName] = value;
454 /// Gets or sets the toolbox icon for FlowDecision.
456 public static DrawingBrush FlowDecision
460 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconName] as DrawingBrush;
465 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconName] = value;
470 /// Gets or sets the icon for the FlowDecision node in the designer.
472 public static DrawingBrush FlowDecisionNode
476 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconBrushName] as DrawingBrush;
481 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowDecisionIconBrushName] = value;
486 /// Gets or sets the toolbox icon for FlowSwitch.
488 public static DrawingBrush FlowSwitch
492 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconName] as DrawingBrush;
497 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconName] = value;
502 /// Gets or sets the icon for the FlowSwitch node in the designer.
504 public static DrawingBrush FlowSwitchNode
508 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconBrushName] as DrawingBrush;
513 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.flowSwitchIconBrushName] = value;
518 /// Gets or sets the icon for ForEach activity.
520 public static DrawingBrush ForEach
524 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.forEachIconName] as DrawingBrush;
529 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.forEachIconName] = value;
534 /// Gets or sets the default icon for custom activities.
536 public static DrawingBrush DefaultCustomActivity
540 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.genericLeafActivityIconName] as DrawingBrush;
545 WorkflowDesignerIcons.IsDefaultCutomActivitySetByUser = true;
546 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.genericLeafActivityIconName] = value;
551 /// Gets or sets the icon for If activity.
553 public static DrawingBrush If
557 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.ifIconName] as DrawingBrush;
562 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.ifIconName] = value;
567 /// Gets or sets the icon for InitializeCorrelation activity.
569 public static DrawingBrush InitializeCorrelation
573 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.initializeCorrelationIconName] as DrawingBrush;
578 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.initializeCorrelationIconName] = value;
583 /// Gets or sets the icon for Interop activity.
585 public static DrawingBrush Interop
589 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.interopIconName] as DrawingBrush;
594 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.interopIconName] = value;
599 /// Gets or sets the icon for InvokeDelegate activity.
601 public static DrawingBrush InvokeDelegate
605 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeDelegateIconName] as DrawingBrush;
610 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeDelegateIconName] = value;
615 /// Gets or sets the icon for InvokeMethod activity.
617 public static DrawingBrush InvokeMethod
621 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeMethodIconName] as DrawingBrush;
626 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.invokeMethodIconName] = value;
631 /// Gets or sets the icon for NoPersistScope activity.
633 public static DrawingBrush NoPersistScope
637 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.noPersistScopeIconName] as DrawingBrush;
642 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.noPersistScopeIconName] = value;
647 /// Gets or sets the icon for ParallelForEach activity.
649 public static DrawingBrush ParallelForEach
653 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelForEachIconName] as DrawingBrush;
658 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelForEachIconName] = value;
663 /// Gets or sets the icon for Parallel activity.
665 public static DrawingBrush Parallel
669 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelIconName] as DrawingBrush;
674 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.parallelIconName] = value;
679 /// Gets or sets the icon for Persist activity.
681 public static DrawingBrush Persist
685 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.persistIconName] as DrawingBrush;
690 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.persistIconName] = value;
695 /// Gets or sets the icon for PickBranch.
697 public static DrawingBrush PickBranch
701 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickBranchIconName] as DrawingBrush;
706 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickBranchIconName] = value;
711 /// Gets or sets the icon for Pick activity.
713 public static DrawingBrush Pick
717 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickIconName] as DrawingBrush;
722 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.pickIconName] = value;
727 /// Gets or sets the icon for ReceiveAndSendReply.
729 public static DrawingBrush ReceiveAndSendReply
733 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveAndSendReplyIconName] as DrawingBrush;
738 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveAndSendReplyIconName] = value;
743 /// Gets or sets the icon for Receive activity.
745 public static DrawingBrush Receive
749 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveIconName] as DrawingBrush;
754 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveIconName] = value;
759 /// Gets or sets the icon for ReceiveReply activity.
761 public static DrawingBrush ReceiveReply
765 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveReplyIconName] as DrawingBrush;
770 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.receiveReplyIconName] = value;
775 /// Gets or sets the icon for RemoveFromCollection activity.
777 public static DrawingBrush RemoveFromCollection
781 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.removeFromCollectionIconName] as DrawingBrush;
786 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.removeFromCollectionIconName] = value;
791 /// Gets or sets the icon for Rethrow activity.
793 public static DrawingBrush Rethrow
797 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.rethrowIconName] as DrawingBrush;
802 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.rethrowIconName] = value;
807 /// Gets or sets the icon for SendAndReceiveReply.
809 public static DrawingBrush SendAndReceiveReply
813 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendAndReceiveReplyIconName] as DrawingBrush;
818 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendAndReceiveReplyIconName] = value;
823 /// Gets or sets the icon for Send activity.
825 public static DrawingBrush Send
829 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendIconName] as DrawingBrush;
834 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendIconName] = value;
839 /// Gets or sets the icon for SendReply activity.
841 public static DrawingBrush SendReply
845 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendReplyIconName] as DrawingBrush;
850 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sendReplyIconName] = value;
855 /// Gets or sets the icon for Sequence activity.
857 public static DrawingBrush Sequence
861 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sequenceIconName] as DrawingBrush;
866 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.sequenceIconName] = value;
871 /// Gets or sets the icon for the Start node. This node is used in StateMachine and Flowchart.
873 public static DrawingBrush StartNode
877 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.startSymbolIconName] as DrawingBrush;
882 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.startSymbolIconName] = value;
887 /// Gets or sets the icon for State.
889 public static DrawingBrush State
893 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateIconName] as DrawingBrush;
898 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateIconName] = value;
903 /// Gets or sets the icon for a state entry in a state machine.
905 public static DrawingBrush StateEntry
909 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.entryIconName] as DrawingBrush;
914 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.entryIconName] = value;
919 /// Gets or sets the icon for a state exit in a state machine.
921 public static DrawingBrush StateExit
925 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.exitIconName] as DrawingBrush;
930 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.exitIconName] = value;
935 /// Gets or sets the icon for StateMachine activity.
937 public static DrawingBrush StateMachine
941 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateMachineIconName] as DrawingBrush;
946 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.stateMachineIconName] = value;
951 /// Gets or sets the icon for Switch activity.
953 public static DrawingBrush Switch
957 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.switchIconName] as DrawingBrush;
962 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.switchIconName] = value;
967 /// Gets or sets the icon for TerminateWorkflow activity.
969 public static DrawingBrush TerminateWorkflow
973 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.terminateWorkflowIconName] as DrawingBrush;
978 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.terminateWorkflowIconName] = value;
983 /// Gets or sets the icon for Throw activity.
985 public static DrawingBrush Throw
989 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.throwIconName] as DrawingBrush;
994 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.throwIconName] = value;
999 /// Gets or sets the icon for TransactedReceiveScope activity.
1001 public static DrawingBrush TransactedReceiveScope
1005 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactedReceiveScopeIconName] as DrawingBrush;
1010 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactedReceiveScopeIconName] = value;
1015 /// Gets or sets the icon for TransactionScope activity.
1017 public static DrawingBrush TransactionScope
1021 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactionScopeIconName] as DrawingBrush;
1026 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transactionScopeIconName] = value;
1031 /// Gets or sets the icon for a state transition in a state machine.
1033 public static DrawingBrush StateTransition
1037 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transitionIconName] as DrawingBrush;
1042 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.transitionIconName] = value;
1047 /// Gets or sets the icon for TryCatch activity.
1049 public static DrawingBrush TryCatch
1053 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.tryCatchIconName] as DrawingBrush;
1058 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.tryCatchIconName] = value;
1063 /// Gets or sets the icon for While activity.
1065 public static DrawingBrush While
1069 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.whileIconName] as DrawingBrush;
1074 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.whileIconName] = value;
1079 /// Gets or sets the icon for WriteLine activity.
1081 public static DrawingBrush WriteLine
1085 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.writeLineIconName] as DrawingBrush;
1090 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.writeLineIconName] = value;
1094 internal static DrawingBrush ToolboxDefaultCustomActivity
1098 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.toolboxDefaultCustomActivityName] as DrawingBrush;
1103 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.toolboxDefaultCustomActivityName] = value;
1109 /// Exposes members representing an icon for the context menu items (right click menu) used in the workflow designer.
1111 [SuppressMessage("Microsoft.Design", "CA1034", Justification = "This is what our design is.")]
1112 public static class ContextMenuItems
1115 /// Gets or sets the icon for the context menu Copy for when the menu is enabled.
1117 public static DrawingBrush Copy
1121 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] as DrawingBrush;
1126 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyIconName] = value;
1131 /// Gets or sets the icon for the context menu Copy for when the menu is disabled.
1133 public static DrawingBrush CopyDisabled
1137 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] as DrawingBrush;
1142 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCopyDisabledIconName] = value;
1147 /// Gets or sets the icon for the context menu Cut for when the menu is enabled.
1149 public static DrawingBrush Cut
1153 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] as DrawingBrush;
1158 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutIconName] = value;
1163 /// Gets or sets the icon for the context menu Cut for when the menu is disabled.
1165 public static DrawingBrush CutDisabled
1169 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] as DrawingBrush;
1174 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationCutDisabledIconName] = value;
1179 /// Gets or sets the icon for the context menu Delete for when the menu is enabled.
1181 public static DrawingBrush Delete
1185 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] as DrawingBrush;
1190 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteIconName] = value;
1195 /// Gets or sets the icon for the context menu Delete for when the menu is disabled.
1197 public static DrawingBrush DeleteDisabled
1201 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] as DrawingBrush;
1206 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationDeleteDisabledIconName] = value;
1211 /// Gets or sets the icon for the context menu Paste for when the menu is enabled.
1213 public static DrawingBrush Paste
1217 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] as DrawingBrush;
1222 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteIconName] = value;
1227 /// Gets or sets the icon for the context menu Paste for when the menu is disabled.
1229 public static DrawingBrush PasteDisabled
1233 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] as DrawingBrush;
1238 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.operationPasteDisabledIconName] = value;
1244 /// Exposes members representing an icon associated with the context menu items (right click menu) used
1245 /// in the workflow designer.
1247 [SuppressMessage("Microsoft.Design", "CA1034", Justification = "This is what our design is.")]
1248 public static class DesignerItems
1251 /// Gets or sets the icon for an annotation.
1253 public static DrawingBrush Annotation
1257 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.annotationIndicatorIconName] as DrawingBrush;
1262 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.annotationIndicatorIconName] = value;
1267 /// Gets or sets the icon mainly for indicating errors in an activity definition.
1268 /// Note that there are 3 properties for error validation icons.
1269 /// These include ActivityErrorValidation, TextBoxErrorValidation and WorkflowErrorValidation.
1270 /// For consistency, the same icon should be used for all of them.
1272 public static DrawingBrush ActivityErrorValidation
1276 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.errorValidationIconName] as DrawingBrush;
1281 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.errorValidationIconName] = value;
1286 /// Gets or sets the icon for the delete button used in DynamicArgumentDialog and TypeCollectionDesigner.
1287 /// The icon is used for when the delete button is enabled.
1289 public static DrawingBrush DeleteButton
1293 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteIconName] as DrawingBrush;
1298 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteIconName] = value;
1303 /// Gets or sets the icon for the delete button used in DynamicArgumentDialog and TypeCollectionDesigner.
1304 /// The icon is used for when the delete button is disabled.
1306 public static DrawingBrush DeleteDisabledButton
1310 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteDisabledIconName] as DrawingBrush;
1315 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.deleteDisabledIconName] = value;
1320 /// Gets or sets the icon for the Fit-To-Screen button located at the bottom right of the designer.
1322 public static DrawingBrush FitToScreen
1326 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.fitToScreenIconName] as DrawingBrush;
1331 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.fitToScreenIconName] = value;
1336 /// Gets or sets the icon for the Overview control button (also known as MiniMap) located at the bottom right of the designer.
1338 public static DrawingBrush Overview
1342 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.minimapIconName] as DrawingBrush;
1347 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.minimapIconName] = value;
1352 /// Gets or sets the icon for the close button used in the Overview control (also known as MiniMap) window.
1354 public static DrawingBrush OverviewWindowCloseButton
1358 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.extensionWindowHeaderCloseButtonName] as DrawingBrush;
1363 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.extensionWindowHeaderCloseButtonName] = value;
1368 /// Gets or sets the icon for the move-down button used in DynamicArgumentDialog and TypeCollectionDesigner.
1369 /// The icon is used for when the delete button is enabled.
1371 public static DrawingBrush MoveDownButton
1375 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownIconName] as DrawingBrush;
1380 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownIconName] = value;
1385 /// Gets or sets the icon for the move-down button used in DynamicArgumentDialog and TypeCollectionDesigner.
1386 /// The icon is used for when the delete button is disabled.
1388 public static DrawingBrush MoveDownDisabledButton
1392 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownDisabledIconName] as DrawingBrush;
1397 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveDownDisabledIconName] = value;
1402 /// Gets or sets the icon for the move-up button used in DynamicArgumentDialog and TypeCollectionDesigner.
1403 /// The icon is used for when the delete button is enabled.
1405 public static DrawingBrush MoveUpButton
1409 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpIconName] as DrawingBrush;
1414 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpIconName] = value;
1419 /// Gets or sets the icon for the move-up button used in DynamicArgumentDialog and TypeCollectionDesigner.
1420 /// The icon is used for when the delete button is disabled.
1422 public static DrawingBrush MoveUpDisabledButton
1426 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpDisabledIconName] as DrawingBrush;
1431 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.moveUpDisabledIconName] = value;
1436 /// Gets or sets the icon for the Pan control button located at the bottom right of the designer.
1438 public static DrawingBrush PanMode
1442 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.panModeIconName] as DrawingBrush;
1447 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.panModeIconName] = value;
1452 /// Gets or sets the icon for the resize grip control found in FlowChart and State.
1454 public static DrawingBrush ResizeGrip
1458 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.resizeGripIconName] as DrawingBrush;
1463 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.resizeGripIconName] = value;
1468 /// Gets or sets the icon mainly for indicating errors in an expression textbox (e.g. textboxes inside an activity designer, property grid, arguments window, etc).
1469 /// Note that there are 3 properties for error validation icons.
1470 /// These include ActivityErrorValidation, TextBoxErrorValidation and WorkflowErrorValidation.
1471 /// For consistency, the same icon should be used for all of them.
1473 public static DrawingBrush TextBoxErrorValidation
1477 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.textBoxErrorIconName] as DrawingBrush;
1482 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.textBoxErrorIconName] = value;
1487 /// Gets or sets the icon mainly for indicating errors occurred when loading an invalid workflow Xaml into the designer.
1488 /// Note that there are 3 properties for error validation icons.
1489 /// These include ActivityErrorValidation, TextBoxErrorValidation and WorkflowErrorValidation.
1490 /// For consistency, the same icon should be used for all of them.
1492 public static DrawingBrush WorkflowErrorValidation
1496 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.validationErrorIconName] as DrawingBrush;
1501 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.validationErrorIconName] = value;
1506 /// Gets or sets the icon for indicating warnings.
1508 public static DrawingBrush WarningValidation
1512 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.warningValidationIconName] as DrawingBrush;
1517 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.warningValidationIconName] = value;
1522 /// Gets or sets the icon for the Zoom control button located at the bottom right of the designer.
1524 public static DrawingBrush Zoom
1528 return WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.zoomIconName] as DrawingBrush;
1533 WorkflowDesignerIcons.IconResourceDictionary[WorkflowDesignerIcons.zoomIconName] = value;