コード例 #1
0
ファイル: SetStateName.cs プロジェクト: eugene-h-lin/csla-svn
        /// <summary>
        /// Look up State and set the state name
        /// </summary>
        /// <param name="context">Rule context object.</param>
        protected override void Execute(RuleContext context)
        {
            var stateId = (string)context.InputPropertyValues[PrimaryProperty];
            var state   = StatesNVL.GetNameValueList().Where(p => p.Key == stateId).FirstOrDefault();

            context.AddOutValue(StateName, state == null ? "Unknown state" : state.Value);
        }
コード例 #2
0
        public Form1()
        {
            InitializeComponent();

            var root = Root.NewEditableRoot();

            statesNVLBindingSource.DataSource  = StatesNVL.GetNameValueList();
            countryNVLBindingSource.DataSource = CountryNVL.GetNameValueList();
            rootBindingSource.DataSource       = root;
        }