private void OnTagValueChanged(MpeTag tag) { if (TagChanged != null) { TagChanged(tag); } }
public void Enable(string tagName) { MpeTag t = this[tagName]; if (t != null) { t.ReadOnly = false; } }
public void Disable(string tagName) { MpeTag t = this[tagName]; if (t != null) { t.ReadOnly = true; } }
public override object ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(String) && value is MpeTag) { MpeTag tag = (MpeTag)value; return(tag.Value); } return(base.ConvertTo(context, culture, value, destinationType)); }
public void Remove(string tagName) { MpeTag tag = this[tagName]; if (tag != null) { hashtable.Remove(tagName); tag.NameChanged -= new MpeTag.NameChangedHandler(OnTagNameChanged); tag.ValueChanged -= new MpeTag.ValueChangedHandler(OnTagValueChanged); if (TagRemoved != null) { TagRemoved(tag); } } }
public void Add(MpeTag tag) { hashtable.Remove(tag.Name); hashtable.Add(tag.Name, tag); if (this["-"] == null) { Add("-", "-", false); } tag.NameChanged += new MpeTag.NameChangedHandler(OnTagNameChanged); tag.ValueChanged += new MpeTag.ValueChangedHandler(OnTagValueChanged); if (TagAdded != null) { TagAdded(tag); } }
public PropertyDescriptorCollection GetProperties() { // Create a new collection object PropertyDescriptorCollection PropertyDescriptorCollection pds = new PropertyDescriptorCollection(null); string[] keys = Keys; for (int i = 0; i < keys.Length; i++) { pds.Add(new MpeTagDescriptor(this[keys[i]])); } MpeTag tag = this["-"]; if (tag != null) { pds.Add(new MpeTagDescriptor(tag)); } return(pds); }
public MpeTag(MpeTag tag) { readOnly = tag.readOnly; tagName = tag.tagName; tagValue = tag.tagValue; }
public MpeTagDescriptor(MpeTag tag) : base("MpeTagDescriptor", null) { this.tag = tag; }
protected virtual void OnTagCollectionChanged(MpeTag tag) { Modified = true; }