示例#1
0
        public void PropertyNameCustomization()
        {
            PropertyDescriptor property = Thing.GetField1Property();

            Assert.AreEqual("Field1", property.Name);
            IPropertyCustomization customization = (IPropertyCustomization)property;

            customization.SetName("FIELD1");
            Assert.AreEqual("FIELD1", property.Name);
        }
示例#2
0
        private static void SetName(PropertyDescriptor property, string name)
        {
            Debug.Assert(property != null);
            Debug.Assert(name != null);
            Debug.Assert(name.Length > 0);

            IPropertyCustomization customization = (IPropertyCustomization)property;

            customization.SetName(name);
        }
示例#3
0
        protected virtual void ApplyCustomization(PropertyDescriptor property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            if (Name.Length == 0)
            {
                return;
            }

            IPropertyCustomization customization = (IPropertyCustomization)property;

            customization.SetName(Name);
        }