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);
        }
Beispiel #8
0
 public MpeTag(MpeTag tag)
 {
   readOnly = tag.readOnly;
   tagName = tag.tagName;
   tagValue = tag.tagValue;
 }
Beispiel #9
0
 public MpeTagDescriptor(MpeTag tag) : base("MpeTagDescriptor", null)
 {
   this.tag = tag;
 }
 private void OnTagValueChanged(MpeTag tag)
 {
   if (TagChanged != null)
   {
     TagChanged(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 MpeTag(MpeTag tag)
 {
     readOnly = tag.readOnly;
     tagName  = tag.tagName;
     tagValue = tag.tagValue;
 }
 public MpeTagDescriptor(MpeTag tag) : base("MpeTagDescriptor", null)
 {
     this.tag = tag;
 }
Beispiel #14
0
 protected virtual void OnTagCollectionChanged(MpeTag tag)
 {
   Modified = true;
 }
Beispiel #15
0
 protected virtual void OnTagCollectionChanged(MpeTag tag)
 {
     Modified = true;
 }