public override void SetAttributeValues(ModelItemAttribute attr) { base.SetAttributeValues(attr); if (attr is ModelAttribute) { ModelAttribute mattr = attr as ModelAttribute; _maxinstances = mattr.MaxInstances; _inherit = mattr.Inherit; } }
/// <summary> /// Virtual method to set the item state depending on the custom attribute definition. /// </summary> public virtual void SetAttributeValues(ModelItemAttribute attr) { if (attr != null) { _weight = attr.Weight; _flags = attr.Flags; _exception = attr.Exception; _exceptionid = attr.ExceptionId; _name = attr.Name; _category = attr.Category; _labels = attr.Labels; } }
string _exceptionid = null; //Invalid Value - throws exception <id> /// <summary> /// Constructor to create an item. /// </summary> /// <param name="attr">Custom attribute specified on the item.</param> public ModelItem(Model model, ModelItemAttribute attr) { _model = model; this.SetAttributeValues(attr); }
/// <summary> /// Virtual method to set the item state depending on the custom attribute definition. /// </summary> public virtual void SetAttributeValues(ModelItemAttribute attr) { if(attr != null) { _weight = attr.Weight; _flags = attr.Flags; _exception = attr.Exception; _exceptionid= attr.ExceptionId; _name = attr.Name; _category = attr.Category; _labels = attr.Labels; } }