Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / WF / Activities / Designers / ParallelDesigner.cs / 1305376 / ParallelDesigner.cs
namespace System.Workflow.Activities { using System; using System.Text; using System.Reflection; using System.Collections; using System.Collections.Generic; using System.CodeDom; using System.ComponentModel; using System.Collections.ObjectModel; using System.ComponentModel.Design; using System.Drawing.Design; using System.Drawing; using System.Drawing.Drawing2D; using System.Workflow.ComponentModel; using System.Workflow.ComponentModel.Design; using System.Runtime.Serialization; #region Class ParallelToolboxItem [Serializable] internal sealed class ParallelToolboxItem: ActivityToolboxItem { public ParallelToolboxItem(Type type) : base(type) { } private ParallelToolboxItem(SerializationInfo info, StreamingContext context) { Deserialize(info, context); } protected override IComponent[] CreateComponentsCore(IDesignerHost designerHost) { CompositeActivity parallelActivity = new ParallelActivity(); parallelActivity.Activities.Add(new SequenceActivity()); parallelActivity.Activities.Add(new SequenceActivity()); return (IComponent[])new IComponent[] {parallelActivity}; } } #endregion #region Class ParallelDesigner [ActivityDesignerTheme(typeof(ParallelDesignerTheme))] internal sealed class ParallelDesigner: ParallelActivityDesigner { #region Properties and Methods protected override CompositeActivity OnCreateNewBranch() { return new SequenceActivity(); } public override bool CanInsertActivities(HitTestInfo insertLocation, ReadOnlyCollectionactivitiesToInsert) { foreach (Activity activity in activitiesToInsert) { if (activity.GetType() != typeof(SequenceActivity)) return false; } return base.CanInsertActivities(insertLocation, activitiesToInsert); } #endregion } #endregion #region ParallelDesignerTheme internal sealed class ParallelDesignerTheme : CompositeDesignerTheme { public ParallelDesignerTheme(WorkflowTheme theme) : base(theme) { this.ShowDropShadow = false; this.ConnectorStartCap = LineAnchor.None; this.ConnectorEndCap = LineAnchor.None; this.ForeColor = Color.FromArgb(0xFF, 0x80, 0x00, 0x80); this.BorderColor = Color.FromArgb(0xFF, 0xE0, 0xE0, 0xE0); this.BorderStyle = DashStyle.Dash; this.BackColorStart = Color.FromArgb(0x00, 0x00, 0x00, 0x00); this.BackColorEnd = Color.FromArgb(0x00, 0x00, 0x00, 0x00); } } #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; using System.Collections.Generic; using System.CodeDom; using System.ComponentModel; using System.Collections.ObjectModel; using System.ComponentModel.Design; using System.Drawing.Design; using System.Drawing; using System.Drawing.Drawing2D; using System.Workflow.ComponentModel; using System.Workflow.ComponentModel.Design; using System.Runtime.Serialization; #region Class ParallelToolboxItem [Serializable] internal sealed class ParallelToolboxItem: ActivityToolboxItem { public ParallelToolboxItem(Type type) : base(type) { } private ParallelToolboxItem(SerializationInfo info, StreamingContext context) { Deserialize(info, context); } protected override IComponent[] CreateComponentsCore(IDesignerHost designerHost) { CompositeActivity parallelActivity = new ParallelActivity(); parallelActivity.Activities.Add(new SequenceActivity()); parallelActivity.Activities.Add(new SequenceActivity()); return (IComponent[])new IComponent[] {parallelActivity}; } } #endregion #region Class ParallelDesigner [ActivityDesignerTheme(typeof(ParallelDesignerTheme))] internal sealed class ParallelDesigner: ParallelActivityDesigner { #region Properties and Methods protected override CompositeActivity OnCreateNewBranch() { return new SequenceActivity(); } public override bool CanInsertActivities(HitTestInfo insertLocation, ReadOnlyCollection activitiesToInsert) { foreach (Activity activity in activitiesToInsert) { if (activity.GetType() != typeof(SequenceActivity)) return false; } return base.CanInsertActivities(insertLocation, activitiesToInsert); } #endregion } #endregion #region ParallelDesignerTheme internal sealed class ParallelDesignerTheme : CompositeDesignerTheme { public ParallelDesignerTheme(WorkflowTheme theme) : base(theme) { this.ShowDropShadow = false; this.ConnectorStartCap = LineAnchor.None; this.ConnectorEndCap = LineAnchor.None; this.ForeColor = Color.FromArgb(0xFF, 0x80, 0x00, 0x80); this.BorderColor = Color.FromArgb(0xFF, 0xE0, 0xE0, 0xE0); this.BorderStyle = DashStyle.Dash; this.BackColorStart = Color.FromArgb(0x00, 0x00, 0x00, 0x00); this.BackColorEnd = Color.FromArgb(0x00, 0x00, 0x00, 0x00); } } #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
- GregorianCalendar.cs
- CallContext.cs
- Exceptions.cs
- DataGridViewMethods.cs
- PersistenceTask.cs
- ExpressionConverter.cs
- ImportDesigner.xaml.cs
- ColorConvertedBitmap.cs
- SynchronousReceiveBehavior.cs
- ConfigXmlComment.cs
- JavaScriptSerializer.cs
- AdCreatedEventArgs.cs
- BinaryMethodMessage.cs
- WorkflowApplicationException.cs
- AuthenticationModuleElementCollection.cs
- AtomServiceDocumentSerializer.cs
- QueryExpr.cs
- ProfilePropertySettingsCollection.cs
- ManifestResourceInfo.cs
- Annotation.cs
- XmlUnspecifiedAttribute.cs
- BezierSegment.cs
- RightsManagementPermission.cs
- DataRelation.cs
- NotificationContext.cs
- sqlinternaltransaction.cs
- OrderingExpression.cs
- _FixedSizeReader.cs
- Vector3DAnimation.cs
- ColumnProvider.cs
- SiteOfOriginPart.cs
- DtdParser.cs
- EncryptedData.cs
- DecimalAnimationUsingKeyFrames.cs
- CommonXSendMessage.cs
- ValidationHelper.cs
- WorkflowRequestContext.cs
- BinaryFormatterWriter.cs
- DispatcherTimer.cs
- ScaleTransform.cs
- NameValuePermission.cs
- WSDualHttpBindingElement.cs
- DocumentReferenceCollection.cs
- ByteStreamMessageEncoder.cs
- ItemAutomationPeer.cs
- DocumentPageHost.cs
- ProfileSection.cs
- Site.cs
- InkPresenterAutomationPeer.cs
- DataTemplateKey.cs
- UriParserTemplates.cs
- MyContact.cs
- BitVec.cs
- WebPartUserCapability.cs
- ImageAutomationPeer.cs
- ServiceCredentialsSecurityTokenManager.cs
- SafeMemoryMappedViewHandle.cs
- RelationshipEndMember.cs
- XPathEmptyIterator.cs
- ImageList.cs
- AspNetRouteServiceHttpHandler.cs
- ProcessProtocolHandler.cs
- TextAnchor.cs
- BitVector32.cs
- EmissiveMaterial.cs
- CounterCreationData.cs
- Int32CollectionValueSerializer.cs
- DataServiceHostFactory.cs
- CompositeTypefaceMetrics.cs
- ModelChangedEventArgsImpl.cs
- ToolStripItemClickedEventArgs.cs
- AuthenticationSection.cs
- SignedXml.cs
- TableLayoutStyleCollection.cs
- ObjectKeyFrameCollection.cs
- XmlDocumentFieldSchema.cs
- XsdDataContractExporter.cs
- DesignerAttribute.cs
- Vector3DCollection.cs
- Size.cs
- SortQueryOperator.cs
- TypeHelper.cs
- ComAdminInterfaces.cs
- MembershipValidatePasswordEventArgs.cs
- XmlCDATASection.cs
- OledbConnectionStringbuilder.cs
- SingleTagSectionHandler.cs
- EditorZoneBase.cs
- TabletDevice.cs
- AnimationException.cs
- LinkLabel.cs
- ExpressionHelper.cs
- SqlTriggerAttribute.cs
- TemplatedAdorner.cs
- Attributes.cs
- XPathAncestorIterator.cs
- TableRowCollection.cs
- SaveFileDialogDesigner.cs
- StringExpressionSet.cs
- SecurityHelper.cs