System.ComponentModel.Design.DesignerOptionService.CreateOptionCollection C# (CSharp) Method

CreateOptionCollection() protected method

Creates a new DesignerOptionCollection with the given name, and adds it to the given parent. The "value" parameter specifies an object whose public properties will be used in the Propeties collection of the option collection. The value parameter can be null if this options collection does not offer any properties. Properties will be wrapped in such a way that passing anything into the component parameter of the property descriptor will be ignored and the value object will be substituted.
protected CreateOptionCollection ( DesignerOptionCollection parent, string name, object value ) : DesignerOptionCollection
parent DesignerOptionCollection
name string
value object
return DesignerOptionCollection
        protected DesignerOptionCollection CreateOptionCollection(DesignerOptionCollection parent, string name, object value)
        {
            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            if (name.Length == 0)
            {
                throw new ArgumentException(SR.Format(SR.InvalidArgument, name.Length.ToString(CultureInfo.CurrentCulture), (0).ToString(CultureInfo.CurrentCulture)), "name.Length");
            }

            return new DesignerOptionCollection(this, parent, name, value);
        }