PickBranch.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx40 / System.Activities / System / Activities / Statements / PickBranch.cs / 1305376 / PickBranch.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.Activities.Statements 
{
    using System.Collections.ObjectModel; 
    using System.ComponentModel; 
    using System.Runtime.Collections;
    using System.Windows.Markup; 

    [ContentProperty("Action")]
    public sealed class PickBranch
    { 
        Collection variables;
        string displayName; 
 
        public PickBranch()
        { 
            displayName = "PickBranch";
        }

        public Collection Variables 
        {
            get 
            { 
                if (this.variables == null)
                { 
                    this.variables = new ValidatingCollection
                    {
                        // disallow null values
                        OnAddValidationCallback = item => 
                        {
                            if (item == null) 
                            { 
                                throw FxTrace.Exception.ArgumentNull("item");
                            } 
                        }
                    };
                }
                return this.variables; 
            }
        } 
 
        [DefaultValue(null)]
        [DependsOn("Variables")] 
        public Activity Trigger { get; set; }

        [DefaultValue(null)]
        [DependsOn("Trigger")] 
        public Activity Action { get; set; }
 
        // 
        [DefaultValue("PickBranch")]
        public string DisplayName 
        {
            get
            {
                return this.displayName; 
            }
            set 
            { 
                this.displayName = value;
            } 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.


                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK