protected override void InternalAddBehavior(IDictionaryBehavior behavior) { if (behavior is IDictionaryInitializer) { AddInitializer((IDictionaryInitializer)behavior); } if (behavior is IDictionaryMetaInitializer) { AddMetaInitializer((IDictionaryMetaInitializer)behavior); } base.InternalAddBehavior(behavior); }
protected virtual void InternalAddBehavior(IDictionaryBehavior behavior) { if (behavior is IDictionaryKeyBuilder) { AddKeyBuilder((IDictionaryKeyBuilder)behavior); } if (behavior is IDictionaryPropertyGetter) { AddGetter((IDictionaryPropertyGetter)behavior); } if (behavior is IDictionaryPropertySetter) { AddSetter((IDictionaryPropertySetter)behavior); } }
/// <summary> /// Adds a single behavior. /// </summary> /// <param name="behavior">The behavior.</param> public PropertyDescriptor AddBehavior(IDictionaryBehavior behavior) { if (behavior == null) { return(this); } var builder = behavior as IDictionaryBehaviorBuilder; if (builder == null) { MergeBehavior(ref dictionaryBehaviors, behavior); } else { foreach (var item in builder.BuildBehaviors()) { AddBehavior(item as IDictionaryBehavior); } } return(this); }