ComponentFactory.Krypton.Toolkit.KryptonGroupPanelDesigner.PreFilterProperties C# (CSharp) Method

PreFilterProperties() protected method

Allows a designer to add to the set of properties that it exposes through a TypeDescriptor.
protected PreFilterProperties ( IDictionary properties ) : void
properties IDictionary The properties for the class of the component.
return void
        protected override void PreFilterProperties(IDictionary properties)
        {
            // Let base clas filter properties first
            base.PreFilterProperties(properties);

            // Remove the design time properties we do not want
            properties.Remove("Modifiers");
            properties.Remove("Locked");
            properties.Remove("GenerateMember");

            // Scan for the 'Name' propertty
            foreach (DictionaryEntry entry in properties)
            {
                // Get the property descriptor for the entry
                PropertyDescriptor descriptor = (PropertyDescriptor)entry.Value;

                // Is this the 'Name' we are searching for?
                if (descriptor.Name.Equals("Name") && descriptor.DesignTimeOnly)
                {
                    // Hide the 'Name' property so the user cannot modify it
                    Attribute[] attributeArray = new Attribute[2] { BrowsableAttribute.No, DesignerSerializationVisibilityAttribute.Hidden };
                    properties[entry.Key] = TypeDescriptor.CreateProperty(descriptor.ComponentType, descriptor, attributeArray);

                    // Finished
                    break;
                }
            }
        }