Пример #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
 /// <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
 /// <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);
 }