Code:
/ 4.0 / 4.0 / untmp / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlUserDefinedAggregateAttribute.cs
- GlyphRun.cs
- PresentationSource.cs
- LinkButton.cs
- peersecurityelement.cs
- XmlSigningNodeWriter.cs
- GlyphRunDrawing.cs
- ObjectItemLoadingSessionData.cs
- ResourceExpression.cs
- SystemInfo.cs
- WorkflowRuntimeEndpoint.cs
- TextShapeableCharacters.cs
- DmlSqlGenerator.cs
- ConfigsHelper.cs
- ZipIORawDataFileBlock.cs
- IntSecurity.cs
- Axis.cs
- ComponentChangingEvent.cs
- ExpandoClass.cs
- CompiledIdentityConstraint.cs
- SerializationStore.cs
- AstNode.cs
- WCFBuildProvider.cs
- ImageResources.Designer.cs
- MdiWindowListStrip.cs
- MissingFieldException.cs
- AQNBuilder.cs
- SignedInfo.cs
- XmlAttributeCache.cs
- SiteMapSection.cs
- TreeNodeEventArgs.cs
- XPathItem.cs
- OrderByQueryOptionExpression.cs
- PointLight.cs
- BindToObject.cs
- SimpleWorkerRequest.cs
- SqlExpander.cs
- NativeMethodsCLR.cs
- Encoder.cs
- PageVisual.cs
- HideDisabledControlAdapter.cs
- PaintEvent.cs
- PropertyChangeTracker.cs
- Debug.cs
- counter.cs
- DecoderReplacementFallback.cs
- ViewEvent.cs
- DESCryptoServiceProvider.cs
- MediaContextNotificationWindow.cs
- XmlSerializerNamespaces.cs
- X509ServiceCertificateAuthentication.cs
- AbsoluteQuery.cs
- TrackingMemoryStream.cs
- XsltFunctions.cs
- ProjectedSlot.cs
- NoPersistProperty.cs
- MetadataAssemblyHelper.cs
- DBConcurrencyException.cs
- VScrollBar.cs
- IPAddress.cs
- DefaultValueMapping.cs
- QueryConverter.cs
- _BasicClient.cs
- Pen.cs
- ScrollBar.cs
- EntityDataSourceWrapperPropertyDescriptor.cs
- OdbcError.cs
- MDIWindowDialog.cs
- HeaderElement.cs
- AlignmentXValidation.cs
- SchemaMapping.cs
- WsiProfilesElementCollection.cs
- SrgsDocument.cs
- SqlEnums.cs
- precedingsibling.cs
- NavigationProperty.cs
- TrackingMemoryStream.cs
- ProviderIncompatibleException.cs
- TraceHandlerErrorFormatter.cs
- ComboBox.cs
- Graph.cs
- RequestNavigateEventArgs.cs
- DisplayNameAttribute.cs
- LeaseManager.cs
- FormViewDesigner.cs
- DataGridViewCellStyleConverter.cs
- SystemIcmpV4Statistics.cs
- RawKeyboardInputReport.cs
- ImplicitInputBrush.cs
- ArgumentOutOfRangeException.cs
- WebControl.cs
- SiteMembershipCondition.cs
- Encoding.cs
- DbgCompiler.cs
- ComplusTypeValidator.cs
- WindowsAltTab.cs
- Msmq3PoisonHandler.cs
- ProfileService.cs
- RightsManagementUser.cs
- SqlDataSourceCommandEventArgs.cs