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