Esempio n. 1
0
        /// <summary>
        /// This member overrides PropertyBag.OnSetValue.
        /// </summary>
        protected override void OnSetValue(PropertySpecEventArgs e)
        {
            string oldValue = this[e.Property.Name] as string;

            this[e.Property.Name] = e.Value;
            base.OnSetValue(e);

            string newValue = e.Value as string;

            if (oldValue != newValue)
            {
                PropertyChanged();
            }
        }
Esempio n. 2
0
        /*
         * public override PropertyDescriptorCollection GetProperties()
         * {
         *  if (m_pdl.Count == 0)
         *  {
         *      PropertyDescriptorCollection pdc = base.GetProperties();
         *      foreach (PropertyDescriptor pd in pdc)
         *      {
         *          if (!(pd is CustomPropertyDescriptor))
         *          {
         *              CustomPropertyDescriptor cpd = new CustomPropertyDescriptor(base.GetPropertyOwner(pd), pd);
         *              m_pdl.Add(cpd);
         *          }
         *      }
         *  }
         *
         *  List<CustomPropertyDescriptor> pdl = m_pdl.FindAll(pd => pd != null);
         *
         *  PropertyDescriptorCollection pdcReturn = SortProperties(m_pdl);
         *
         *  return pdcReturn;
         * }*/

        /// <summary>
        /// This member overrides PropertyBag.OnGetValue.
        /// </summary>
        protected override void OnGetValue(PropertySpecEventArgs e)
        {
            e.Value = this[e.Property.Name];
            base.OnGetValue(e);
        }