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
- UrlUtility.cs
- DataGridViewCellStyleConverter.cs
- SettingsProviderCollection.cs
- QueueProcessor.cs
- WindowsRegion.cs
- ObsoleteAttribute.cs
- ReadOnlyDictionary.cs
- PenLineJoinValidation.cs
- MimeFormatter.cs
- IteratorFilter.cs
- EventMappingSettings.cs
- HuffmanTree.cs
- UpdateException.cs
- ValidationHelper.cs
- CollectionView.cs
- SmiEventSink.cs
- Pts.cs
- CompiledIdentityConstraint.cs
- ResourceManagerWrapper.cs
- BindingBase.cs
- ObjectResult.cs
- ProtocolsConfigurationHandler.cs
- StyleHelper.cs
- XmlSerializer.cs
- HttpCachePolicy.cs
- TextOutput.cs
- ValueSerializer.cs
- FilteredDataSetHelper.cs
- ValidatingReaderNodeData.cs
- UserControl.cs
- ParentQuery.cs
- ModelItemCollection.cs
- FontSource.cs
- ButtonBaseAdapter.cs
- RectangleF.cs
- SoapEnumAttribute.cs
- ScrollBarAutomationPeer.cs
- ActivityCodeDomSerializer.cs
- SchemaSetCompiler.cs
- ExclusiveTcpListener.cs
- ToolboxCategory.cs
- CqlParserHelpers.cs
- TextEncodedRawTextWriter.cs
- SoapFormatterSinks.cs
- ValidationEventArgs.cs
- RelationshipEntry.cs
- PageClientProxyGenerator.cs
- NativeWindow.cs
- PersonalizationEntry.cs
- ToolStripDropDownItem.cs
- WebSysDisplayNameAttribute.cs
- HeaderUtility.cs
- ResourceWriter.cs
- DebugHandleTracker.cs
- AdjustableArrowCap.cs
- Helper.cs
- ManagedFilter.cs
- ProfileSection.cs
- FormsAuthenticationEventArgs.cs
- PropertyInfoSet.cs
- ClientApiGenerator.cs
- CodeTypeReference.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- GrammarBuilderBase.cs
- OdbcConnection.cs
- SqlUserDefinedTypeAttribute.cs
- ForAllOperator.cs
- SiteMapDataSource.cs
- XpsS0ValidatingLoader.cs
- HtmlInputReset.cs
- TextMetrics.cs
- BinHexDecoder.cs
- SmtpMail.cs
- InkSerializer.cs
- DataServiceQuery.cs
- SafeCryptoKeyHandle.cs
- ServiceMemoryGates.cs
- EtwTrace.cs
- SrgsToken.cs
- _ShellExpression.cs
- PrintPreviewDialog.cs
- PathSegment.cs
- CodeEntryPointMethod.cs
- BitmapEffectDrawingContent.cs
- ViewStateModeByIdAttribute.cs
- DoubleLinkList.cs
- DataGridColumnFloatingHeader.cs
- KeyConstraint.cs
- Point3DCollectionConverter.cs
- ConfigPathUtility.cs
- HostProtectionException.cs
- WebPartVerbCollection.cs
- ChangeBlockUndoRecord.cs
- FilteredDataSetHelper.cs
- ISAPIWorkerRequest.cs
- DataBoundControl.cs
- SizeF.cs
- RuleSet.cs
- BamlResourceContent.cs
- UiaCoreApi.cs