Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / Rules / Design / DesignerHelpers.cs / 1305376 / DesignerHelpers.cs
using System; using System.CodeDom; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Workflow.ComponentModel; using System.Workflow.ComponentModel.Serialization; using System.Text; namespace System.Workflow.Activities.Rules.Design { ////// Summary description for DesignerHelpers. /// internal static class DesignerHelpers { internal static void DisplayError(string message, string messageBoxTitle, IServiceProvider serviceProvider) { IUIService uis = null; if (serviceProvider != null) uis = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uis != null) uis.ShowError(message); else MessageBox.Show(message, messageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, 0); } static internal string GetRulePreview(Rule rule) { StringBuilder rulePreview = new StringBuilder(); if (rule != null) { rulePreview.Append("IF "); if (rule.Condition != null) rulePreview.Append(rule.Condition.ToString() + " "); rulePreview.Append("THEN "); foreach (RuleAction action in rule.ThenActions) { rulePreview.Append(action.ToString()); rulePreview.Append(' '); } if (rule.ElseActions.Count > 0) { rulePreview.Append("ELSE "); foreach (RuleAction action in rule.ElseActions) { rulePreview.Append(action.ToString()); rulePreview.Append(' '); } } } return rulePreview.ToString(); } static internal string GetRuleSetPreview(RuleSet ruleSet) { StringBuilder preview = new StringBuilder(); bool first = true; if (ruleSet != null) { foreach (Rule rule in ruleSet.Rules) { if (first) first = false; else preview.Append("\n"); preview.Append(rule.Name); preview.Append(": "); preview.Append(DesignerHelpers.GetRulePreview(rule)); } } return preview.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System; using System.CodeDom; using System.Collections; using System.Collections.Generic; using System.Drawing; using System.IO; using System.Windows.Forms; using System.Windows.Forms.Design; using System.Workflow.ComponentModel; using System.Workflow.ComponentModel.Serialization; using System.Text; namespace System.Workflow.Activities.Rules.Design { ////// Summary description for DesignerHelpers. /// internal static class DesignerHelpers { internal static void DisplayError(string message, string messageBoxTitle, IServiceProvider serviceProvider) { IUIService uis = null; if (serviceProvider != null) uis = (IUIService)serviceProvider.GetService(typeof(IUIService)); if (uis != null) uis.ShowError(message); else MessageBox.Show(message, messageBoxTitle, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1, 0); } static internal string GetRulePreview(Rule rule) { StringBuilder rulePreview = new StringBuilder(); if (rule != null) { rulePreview.Append("IF "); if (rule.Condition != null) rulePreview.Append(rule.Condition.ToString() + " "); rulePreview.Append("THEN "); foreach (RuleAction action in rule.ThenActions) { rulePreview.Append(action.ToString()); rulePreview.Append(' '); } if (rule.ElseActions.Count > 0) { rulePreview.Append("ELSE "); foreach (RuleAction action in rule.ElseActions) { rulePreview.Append(action.ToString()); rulePreview.Append(' '); } } } return rulePreview.ToString(); } static internal string GetRuleSetPreview(RuleSet ruleSet) { StringBuilder preview = new StringBuilder(); bool first = true; if (ruleSet != null) { foreach (Rule rule in ruleSet.Rules) { if (first) first = false; else preview.Append("\n"); preview.Append(rule.Name); preview.Append(": "); preview.Append(DesignerHelpers.GetRulePreview(rule)); } } return preview.ToString(); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- XmlSchemaRedefine.cs
- IgnoreSection.cs
- Hyperlink.cs
- DbConnectionHelper.cs
- validationstate.cs
- Compensate.cs
- Utils.cs
- FlowPosition.cs
- ObjectPersistData.cs
- HttpRequest.cs
- TransformConverter.cs
- VirtualizingPanel.cs
- Padding.cs
- HtmlDocument.cs
- MediaElement.cs
- PeerApplicationLaunchInfo.cs
- DynamicRenderer.cs
- DataBinding.cs
- ConstructorNeedsTagAttribute.cs
- InplaceBitmapMetadataWriter.cs
- RelatedEnd.cs
- IisTraceListener.cs
- MetadataArtifactLoaderResource.cs
- SizeKeyFrameCollection.cs
- SBCSCodePageEncoding.cs
- Main.cs
- ScriptingWebServicesSectionGroup.cs
- StateItem.cs
- BitmapEffectGeneralTransform.cs
- OrCondition.cs
- AutomationFocusChangedEventArgs.cs
- ComponentDispatcher.cs
- XmlFormatExtensionPrefixAttribute.cs
- ConstraintStruct.cs
- DrawingGroup.cs
- ChtmlTextWriter.cs
- ActivityWithResultValueSerializer.cs
- ResXBuildProvider.cs
- RuntimeConfigLKG.cs
- TagMapCollection.cs
- TextEncodedRawTextWriter.cs
- MTConfigUtil.cs
- AssociationSetMetadata.cs
- DesignerPerfEventProvider.cs
- TreeViewImageGenerator.cs
- WebServiceMethodData.cs
- odbcmetadatacolumnnames.cs
- ToolStripItemClickedEventArgs.cs
- StringToken.cs
- BindToObject.cs
- SessionEndingEventArgs.cs
- XmlIgnoreAttribute.cs
- BlockCollection.cs
- MaterialCollection.cs
- InheritanceAttribute.cs
- ObjectStorage.cs
- Metafile.cs
- MessageSecurityOverMsmqElement.cs
- ZipFileInfoCollection.cs
- ContentControl.cs
- Point4D.cs
- KeyEvent.cs
- MessageUtil.cs
- SHA512.cs
- LinkedDataMemberFieldEditor.cs
- SubclassTypeValidator.cs
- DataGridViewToolTip.cs
- UnsafeCollabNativeMethods.cs
- ContentOperations.cs
- WebPartTransformer.cs
- OptimizedTemplateContentHelper.cs
- Matrix.cs
- ItemDragEvent.cs
- Constants.cs
- HandleRef.cs
- RootDesignerSerializerAttribute.cs
- CompiledQueryCacheEntry.cs
- XmlDataFileEditor.cs
- DebuggerAttributes.cs
- DropShadowBitmapEffect.cs
- WebPartDisplayModeEventArgs.cs
- CategoryAttribute.cs
- CriticalFinalizerObject.cs
- BitmapCacheBrush.cs
- BookmarkInfo.cs
- IncrementalHitTester.cs
- SizeValueSerializer.cs
- SuppressMessageAttribute.cs
- TypeForwardedToAttribute.cs
- TypeDescriptor.cs
- CfgParser.cs
- ColumnResizeUndoUnit.cs
- InvalidProgramException.cs
- TypeInfo.cs
- RotateTransform3D.cs
- InteropBitmapSource.cs
- WMICapabilities.cs
- WriteFileContext.cs
- SerialReceived.cs
- ChannelManagerService.cs