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
- QilStrConcatenator.cs
- MsdtcClusterUtils.cs
- LinearKeyFrames.cs
- RecognizerStateChangedEventArgs.cs
- FormsAuthenticationCredentials.cs
- RandomNumberGenerator.cs
- NullReferenceException.cs
- SimpleBitVector32.cs
- RtType.cs
- ScriptingRoleServiceSection.cs
- AppDomainFactory.cs
- embossbitmapeffect.cs
- SoapProtocolImporter.cs
- HttpConfigurationContext.cs
- MetabaseServerConfig.cs
- CodeIterationStatement.cs
- ChtmlTextBoxAdapter.cs
- WindowsFormsHostPropertyMap.cs
- SynchronizingStream.cs
- BinaryReader.cs
- FilteredAttributeCollection.cs
- Keywords.cs
- Odbc32.cs
- ValueUnavailableException.cs
- Binding.cs
- ExpressionVisitor.cs
- CodeCommentStatementCollection.cs
- BinaryReader.cs
- Region.cs
- _CommandStream.cs
- hresults.cs
- PersonalizationDictionary.cs
- ColumnMap.cs
- EntityWrapper.cs
- QueryOutputWriterV1.cs
- ImageSource.cs
- Constraint.cs
- Decoder.cs
- FormViewInsertedEventArgs.cs
- CommandTreeTypeHelper.cs
- DataGridViewCellFormattingEventArgs.cs
- DropSource.cs
- ToolStripDropDown.cs
- SchemaExporter.cs
- LayeredChannelFactory.cs
- ClientData.cs
- StrokeCollectionConverter.cs
- updatecommandorderer.cs
- SHA384Cng.cs
- DataKeyCollection.cs
- Vector3DKeyFrameCollection.cs
- ComboBox.cs
- NewItemsContextMenuStrip.cs
- SqlBooleanizer.cs
- DecimalKeyFrameCollection.cs
- AssemblyNameProxy.cs
- IHttpResponseInternal.cs
- CheckBoxFlatAdapter.cs
- safePerfProviderHandle.cs
- MouseButtonEventArgs.cs
- CalendarDay.cs
- BuildManager.cs
- GlobalizationSection.cs
- Int32Rect.cs
- ReturnEventArgs.cs
- DashStyles.cs
- TreeIterator.cs
- CallbackTimeoutsBehavior.cs
- SimpleHandlerFactory.cs
- ThemeDirectoryCompiler.cs
- TimeStampChecker.cs
- SQLUtility.cs
- FileDetails.cs
- Timer.cs
- DbConnectionPoolOptions.cs
- StorageEntityTypeMapping.cs
- SafeMILHandle.cs
- CodeCatchClauseCollection.cs
- CroppedBitmap.cs
- SafeIUnknown.cs
- CellTreeNode.cs
- TextServicesPropertyRanges.cs
- FontNamesConverter.cs
- XmlEncoding.cs
- HttpCookiesSection.cs
- PointLight.cs
- BindingValueChangedEventArgs.cs
- FontUnitConverter.cs
- SoapInteropTypes.cs
- StylusShape.cs
- RepeatBehaviorConverter.cs
- ProcessThreadDesigner.cs
- sqlstateclientmanager.cs
- RawStylusInput.cs
- MethodCallTranslator.cs
- PageWrapper.cs
- GeneralTransform3D.cs
- UpdateDelegates.Generated.cs
- ECDiffieHellmanCng.cs
- Visual3D.cs