コード例 #1
0
            public override object GetValue(object component)
            {
                // Have the property bag raise an event to get the current value
                // of the property.

                var e = new PropertySpecEventArgs(_item, null);

                _bag.OnGetValue(e);
                if (e.Value is BusinessRuleProperty)
                {
                    return((e.Value as BusinessRuleProperty).Value);
                }

                return(e.Value);
            }
コード例 #2
0
ファイル: CriteriaBag.cs プロジェクト: rajeshwarn/CslaGenFork
 /// <summary>
 /// Raises the SetValue event.
 /// </summary>
 /// <param name="e">A PropertySpecEventArgs that contains the event data.</param>
 protected virtual void OnSetValue(PropertySpecEventArgs e)
 {
     if (SetValue != null)
         SetValue(this, e);
     SetProperty(e.Property.TargetObject, e.Property.TargetProperty, e.Value);
 }
コード例 #3
0
ファイル: CriteriaBag.cs プロジェクト: rajeshwarn/CslaGenFork
 /// <summary>
 /// Raises the GetValue event.
 /// </summary>
 /// <param name="e">A PropertySpecEventArgs that contains the event data.</param>
 protected virtual void OnGetValue(PropertySpecEventArgs e)
 {
     if (e.Value != null)
         GetValue(this, e);
     e.Value = GetProperty(e.Property.TargetObject, e.Property.TargetProperty, e.Property.DefaultValue);
 }