Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / Designers / StateMachineWorkflowDesigner.cs / 1305376 / StateMachineWorkflowDesigner.cs
namespace System.Workflow.Activities
{
using System;
using System.Text;
using System.Reflection;
using System.Collections.ObjectModel;
using System.Collections;
using System.CodeDom;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.Workflow.ComponentModel.Serialization;
using System.Collections.Generic;
#region StateMachineWorkflowDesigner
[ActivityDesignerTheme(typeof(StateMachineWorkflowDesignerTheme))]
[System.Runtime.InteropServices.ComVisible(false)]
internal sealed class StateMachineWorkflowDesigner : StateDesigner
{
#region Fields
private static readonly Size MinSize = new Size(240, 240);
private string text;
private string helpText;
#endregion
#region Constructor
///
/// Default constructor for the StateDesignerBase
///
public StateMachineWorkflowDesigner()
{
}
protected override void Initialize(Activity activity)
{
base.Initialize(activity);
text = DR.GetString(DR.EventBasedWorkFlow);
}
#endregion
#region Properties
#region Public Properties
public override string Text
{
get
{
return text;
}
}
#endregion
#region Private Properties
internal override string HelpText
{
get
{
if (helpText == null)
{
helpText = DR.GetString(DR.StateMachineWorkflowHelpText);
}
return helpText;
}
}
public override Size MinimumSize
{
get
{
Size minimumSize = base.MinimumSize;
minimumSize.Width = Math.Max(minimumSize.Width, MinSize.Width);
minimumSize.Height = Math.Max(minimumSize.Height, MinSize.Height);
if (IsRootDesigner && InvokingDesigner == null)
{
minimumSize.Width = Math.Max(minimumSize.Width, ParentView.ViewPortSize.Width - StateDesigner.Separator.Width * 2);
minimumSize.Height = Math.Max(minimumSize.Height, ParentView.ViewPortSize.Height - StateDesigner.Separator.Height * 2);
}
return minimumSize;
}
}
#endregion Private Properties
#endregion
#region Methods
#region Public Methods
#endregion
#region Protected Methods
protected override bool IsSupportedActivityType(Type activityType)
{
//we specifically, do not support state machine related activities.
if (typeof(ListenActivity).IsAssignableFrom(activityType))
return false;
return base.IsSupportedActivityType(activityType);
}
#endregion
#region Private Methods
#endregion Private Methods
#endregion Methods
}
#endregion
#region StateMachineWorkflowDesignerTheme
internal sealed class StateMachineWorkflowDesignerTheme : StateMachineTheme
{
public StateMachineWorkflowDesignerTheme(WorkflowTheme theme)
: base(theme)
{
this.ShowDropShadow = true;
this.ConnectorStartCap = LineAnchor.DiamondAnchor;
this.ConnectorEndCap = LineAnchor.ArrowAnchor;
this.ForeColor = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);
this.BorderColor = Color.FromArgb(0xFF, 0x49, 0x77, 0xB4);
this.BorderStyle = DashStyle.Solid;
this.BackColorStart = Color.FromArgb(0x00, 0x00, 0x00, 0x00);
this.BackColorEnd = Color.FromArgb(0x00, 0x00, 0x00, 0x00);
}
[Browsable(false)]
public override string InitialStateDesignerImagePath
{
get
{
return base.InitialStateDesignerImagePath;
}
set
{
base.InitialStateDesignerImagePath = value;
}
}
[Browsable(false)]
public override string CompletedStateDesignerImagePath
{
get
{
return base.CompletedStateDesignerImagePath;
}
set
{
base.CompletedStateDesignerImagePath = value;
}
}
}
#endregion
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
namespace System.Workflow.Activities
{
using System;
using System.Text;
using System.Reflection;
using System.Collections.ObjectModel;
using System.Collections;
using System.CodeDom;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.Workflow.ComponentModel.Serialization;
using System.Collections.Generic;
#region StateMachineWorkflowDesigner
[ActivityDesignerTheme(typeof(StateMachineWorkflowDesignerTheme))]
[System.Runtime.InteropServices.ComVisible(false)]
internal sealed class StateMachineWorkflowDesigner : StateDesigner
{
#region Fields
private static readonly Size MinSize = new Size(240, 240);
private string text;
private string helpText;
#endregion
#region Constructor
///
/// Default constructor for the StateDesignerBase
///
public StateMachineWorkflowDesigner()
{
}
protected override void Initialize(Activity activity)
{
base.Initialize(activity);
text = DR.GetString(DR.EventBasedWorkFlow);
}
#endregion
#region Properties
#region Public Properties
public override string Text
{
get
{
return text;
}
}
#endregion
#region Private Properties
internal override string HelpText
{
get
{
if (helpText == null)
{
helpText = DR.GetString(DR.StateMachineWorkflowHelpText);
}
return helpText;
}
}
public override Size MinimumSize
{
get
{
Size minimumSize = base.MinimumSize;
minimumSize.Width = Math.Max(minimumSize.Width, MinSize.Width);
minimumSize.Height = Math.Max(minimumSize.Height, MinSize.Height);
if (IsRootDesigner && InvokingDesigner == null)
{
minimumSize.Width = Math.Max(minimumSize.Width, ParentView.ViewPortSize.Width - StateDesigner.Separator.Width * 2);
minimumSize.Height = Math.Max(minimumSize.Height, ParentView.ViewPortSize.Height - StateDesigner.Separator.Height * 2);
}
return minimumSize;
}
}
#endregion Private Properties
#endregion
#region Methods
#region Public Methods
#endregion
#region Protected Methods
protected override bool IsSupportedActivityType(Type activityType)
{
//we specifically, do not support state machine related activities.
if (typeof(ListenActivity).IsAssignableFrom(activityType))
return false;
return base.IsSupportedActivityType(activityType);
}
#endregion
#region Private Methods
#endregion Private Methods
#endregion Methods
}
#endregion
#region StateMachineWorkflowDesignerTheme
internal sealed class StateMachineWorkflowDesignerTheme : StateMachineTheme
{
public StateMachineWorkflowDesignerTheme(WorkflowTheme theme)
: base(theme)
{
this.ShowDropShadow = true;
this.ConnectorStartCap = LineAnchor.DiamondAnchor;
this.ConnectorEndCap = LineAnchor.ArrowAnchor;
this.ForeColor = Color.FromArgb(0xFF, 0x00, 0x00, 0x00);
this.BorderColor = Color.FromArgb(0xFF, 0x49, 0x77, 0xB4);
this.BorderStyle = DashStyle.Solid;
this.BackColorStart = Color.FromArgb(0x00, 0x00, 0x00, 0x00);
this.BackColorEnd = Color.FromArgb(0x00, 0x00, 0x00, 0x00);
}
[Browsable(false)]
public override string InitialStateDesignerImagePath
{
get
{
return base.InitialStateDesignerImagePath;
}
set
{
base.InitialStateDesignerImagePath = value;
}
}
[Browsable(false)]
public override string CompletedStateDesignerImagePath
{
get
{
return base.CompletedStateDesignerImagePath;
}
set
{
base.CompletedStateDesignerImagePath = value;
}
}
}
#endregion
}
// 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
- recordstatescratchpad.cs
- ConfigurationManagerInternal.cs
- PageSettings.cs
- Trace.cs
- SelectionEditingBehavior.cs
- ConnectionsZone.cs
- CodeIterationStatement.cs
- DatatypeImplementation.cs
- ChannelBuilder.cs
- TrackingStringDictionary.cs
- BreakRecordTable.cs
- SystemFonts.cs
- TextBox.cs
- HttpsChannelFactory.cs
- GlyphRunDrawing.cs
- DiscoveryClient.cs
- ElementNotEnabledException.cs
- ScrollBarAutomationPeer.cs
- Pipe.cs
- JsonServiceDocumentSerializer.cs
- NativeWrapper.cs
- SafeNativeMethods.cs
- SqlConnectionPoolProviderInfo.cs
- XmlJsonReader.cs
- StreamSecurityUpgradeProvider.cs
- HtmlTableCell.cs
- QueryResult.cs
- HtmlEmptyTagControlBuilder.cs
- Matrix3DValueSerializer.cs
- storepermissionattribute.cs
- MenuItemStyleCollection.cs
- RadioButtonList.cs
- SystemUnicastIPAddressInformation.cs
- Transactions.cs
- MemberAssignmentAnalysis.cs
- DataQuery.cs
- AbstractExpressions.cs
- CodeMemberMethod.cs
- SystemIPv6InterfaceProperties.cs
- SizeLimitedCache.cs
- CategoryState.cs
- MsmqHostedTransportManager.cs
- Pair.cs
- CLSCompliantAttribute.cs
- SecurityState.cs
- CorruptingExceptionCommon.cs
- MenuAutoFormat.cs
- RoleService.cs
- Models.cs
- Trace.cs
- ObfuscationAttribute.cs
- ControlType.cs
- CrossContextChannel.cs
- CounterSetInstanceCounterDataSet.cs
- AssociationSetMetadata.cs
- Animatable.cs
- ImageMapEventArgs.cs
- SimpleTextLine.cs
- AccessText.cs
- Image.cs
- TimeManager.cs
- StreamWriter.cs
- PropertyInformationCollection.cs
- DictionaryEditChange.cs
- ColumnHeader.cs
- GridViewRowPresenterBase.cs
- PropertyChangeTracker.cs
- CollectionChangedEventManager.cs
- XmlSchemaObjectCollection.cs
- ServiceModelEnumValidator.cs
- TreeNodeEventArgs.cs
- PropertyEmitterBase.cs
- CategoryAttribute.cs
- ErrorsHelper.cs
- XmlAttributes.cs
- IpcManager.cs
- ObjectQueryState.cs
- UriTemplateDispatchFormatter.cs
- MetadataItemEmitter.cs
- Odbc32.cs
- UnsafeNativeMethods.cs
- WindowHideOrCloseTracker.cs
- CodeAttributeArgumentCollection.cs
- IdentityManager.cs
- AspNetSynchronizationContext.cs
- SortDescription.cs
- RankException.cs
- WindowsIdentity.cs
- XmlDataSourceNodeDescriptor.cs
- GrammarBuilderDictation.cs
- DataRow.cs
- IndicCharClassifier.cs
- NativeMethods.cs
- EdmProviderManifest.cs
- SafeProcessHandle.cs
- PluralizationService.cs
- URLAttribute.cs
- ProxyHelper.cs
- ControlCodeDomSerializer.cs
- SqlTransaction.cs