1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
|
namespace System.Workflow.Activities
{
using System;
using System.Xml.Serialization;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Design;
using System.Reflection;
using System.Workflow.ComponentModel;
using System.Workflow.ComponentModel.Design;
using System.ComponentModel.Design.Serialization;
using System.Workflow.ComponentModel.Compiler;
[SRDescription(SR.StateMachineWorkflowActivityDescription)]
[Designer(typeof(StateMachineWorkflowDesigner), typeof(IRootDesigner))]
[Designer(typeof(StateMachineWorkflowDesigner), typeof(IDesigner))]
[ToolboxItem(false)]
[ToolboxBitmap(typeof(StateMachineWorkflowActivity), "Resources.StateMachineWorkflowActivity.png")]
[ActivityValidator(typeof(StateActivityValidator))]
[SRCategory(SR.Standard)]
[SRDisplayName(SR.StateMachineWorkflow)]
[System.Runtime.InteropServices.ComVisible(false)]
[Obsolete("The System.Workflow.* types are deprecated. Instead, please use the new types from System.Activities.*")]
public class StateMachineWorkflowActivity : StateActivity
{
internal const string InitialStateNamePropertyName = "InitialStateName";
internal const string CompletedStateNamePropertyName = "CompletedStateName";
public const string SetStateQueueName = "SetStateQueue";
//metadata properties
public static readonly DependencyProperty InitialStateNameProperty = DependencyProperty.Register(StateMachineWorkflowActivity.InitialStateNamePropertyName, typeof(string), typeof(StateMachineWorkflowActivity), new PropertyMetadata(DependencyPropertyOptions.Metadata));
public static readonly DependencyProperty CompletedStateNameProperty = DependencyProperty.Register(StateMachineWorkflowActivity.CompletedStateNamePropertyName, typeof(string), typeof(StateMachineWorkflowActivity), new PropertyMetadata(DependencyPropertyOptions.Metadata));
public StateMachineWorkflowActivity()
{
}
public StateMachineWorkflowActivity(string name)
: base(name)
{
}
[SRDescription(SR.DynamicUpdateConditionDescr)]
[SRCategory(SR.Conditions)]
public ActivityCondition DynamicUpdateCondition
{
get
{
return WorkflowChanges.GetCondition(this) as ActivityCondition;
}
set
{
WorkflowChanges.SetCondition(this, value);
}
}
[ValidationOption(ValidationOption.Optional)]
[SRDescription(SR.InitialStateDescription)]
[Editor(typeof(StateDropDownEditor), typeof(UITypeEditor))]
[DefaultValue("")]
public string InitialStateName
{
get
{
return (string)base.GetValue(InitialStateNameProperty);
}
set
{
base.SetValue(InitialStateNameProperty, value);
}
}
[SRDescription(SR.CompletedStateDescription)]
[Editor(typeof(StateDropDownEditor), typeof(UITypeEditor))]
[DefaultValue("")]
public string CompletedStateName
{
get
{
return (string)base.GetValue(CompletedStateNameProperty);
}
set
{
base.SetValue(CompletedStateNameProperty, value);
}
}
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string CurrentStateName
{
get
{
StateMachineExecutionState executionState = this.ExecutionState;
if (executionState == null)
return null;
return executionState.CurrentStateName;
}
}
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string PreviousStateName
{
get
{
StateMachineExecutionState executionState = this.ExecutionState;
if (executionState == null)
return null;
return executionState.PreviousStateName;
}
}
internal StateMachineExecutionState ExecutionState
{
get
{
return (StateMachineExecutionState)base.GetValue(StateMachineExecutionStateProperty);
}
}
}
}
|