コード例 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CanWrite"/> class.
        /// </summary>
        /// <param name="primaryProperty">
        /// The primary property.
        /// </param>
        /// <param name="innerRule">
        /// The inner rule.
        /// </param>
        public CanWrite(IPropertyInfo primaryProperty, IBusinessRule innerRule)
            : base(primaryProperty)
        {
            InputProperties = new List <IPropertyInfo> {
                primaryProperty
            };
            InnerRule = innerRule;
            RuleUri.AddQueryParameter("rule", System.Uri.EscapeUriString(InnerRule.RuleName));

            // merge InnerRule input property list into this rule's list
            if (InnerRule.InputProperties != null)
            {
                InputProperties.AddRange(InnerRule.InputProperties);
            }

            // remove any duplicates
            InputProperties = new List <IPropertyInfo>(InputProperties.Distinct());
            AffectedProperties.AddRange(innerRule.AffectedProperties);
        }
コード例 #2
0
 /// <summary>
 /// Creates an instance of the rule.
 /// </summary>
 /// <param name="primaryProperty">Primary property for the rule.</param>
 /// <param name="dependencyProperty">Dependent property.</param>
 /// <remarks>
 /// When rules are run for the primary property, they will also be run for the dependent
 /// property. Add a Dependency rule to a property when changing that property should run rules
 /// on some other property, and you have no other rules that would establish this dependent
 /// or affected property relationship.
 /// </remarks>
 public Dependency(Csla.Core.IPropertyInfo primaryProperty, params Csla.Core.IPropertyInfo[] dependencyProperty)
     : base(primaryProperty)
 {
     AffectedProperties.AddRange(dependencyProperty);
 }
コード例 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RaisePropertyChanged" /> class.
 /// </summary>
 /// <param name="primaryProperty">The primary property.</param>
 /// <param name="raiseChangedProperties">The raise changed properties.</param>
 public RaisePropertyChanged(IPropertyInfo primaryProperty, params IPropertyInfo[] raiseChangedProperties)
     : base(primaryProperty)
 {
     AffectedProperties.AddRange(raiseChangedProperties);
 }
コード例 #4
0
ファイル: Root.cs プロジェクト: zuiwanting/csla
 /// <summary>
 /// Initializes a new instance of the <see cref="ValidateRoot"/> class.
 /// </summary>
 /// <param name="fields">
 /// The fields.
 /// </param>
 public ValidateRoot(IEnumerable <IPropertyInfo> fields)
 {
     AffectedProperties.AddRange(fields);
 }