//------------------------------------------------------------------------------ // // Copyright (c) Microsoft Corporation. All rights reserved. // //------------------------------------------------------------------------------ namespace System.Activities.Statements { using System.Activities; using System.ComponentModel; using System.Windows.Markup; /// /// This class represents a Transition of a State. /// public sealed class Transition { /// /// Gets or sets the Action activity which should be executed when the Transtion is taken. /// It's optional. /// [DependsOn("To")] [DefaultValue(null)] public Activity Action { get; set; } /// /// Gets or sets the Condition to decide whether the Transition should be taken after the Trigger activity is completed. /// It's optional. /// If the Condition is null, the Transition would always be taken when the Trigger activity is completed. /// [DependsOn("Action")] [DefaultValue(null)] public Activity Condition { get; set; } /// /// Gets or sets DisplayName of the Transition /// public string DisplayName { get; set; } /// /// Gets or sets the target State of the Transition. /// It's required. /// [DependsOn("Trigger")] [DefaultValue(null)] public State To { get; set; } /// /// Gets or sets the Trigger activity of the Transition. /// When the Trigger activity is completed, the StateMachine will start to evaluate whether the Transition should be taken. /// It's required. /// [DefaultValue(null)] public Activity Trigger { get; set; } /// /// Gets the actual Trigger activity object that should be used when scheduling Transition trigger /// between states. /// Returns the Trigger object if if it is defined by the user; otherwise, return the null trigger. /// internal Activity ActiveTrigger { get { return this.Trigger != null ? this.Trigger : this.Source.NullTrigger; } } /// /// Gets or sets Transition Id, which is unique within a State inside a StateMachine. /// internal string Id { get; set; } /// /// Gets or sets Source, which represents source state of transition /// internal State Source { get; set; } } }