DesignerOptionService::CreateOptionCollection Method (DesignerOptionService::DesignerOptionCollection^, String^, Object^)
Creates a new DesignerOptionService::DesignerOptionCollection with the given name and adds it to the given parent.
Assembly: System (in System.dll)
protected: DesignerOptionService::DesignerOptionCollection^ CreateOptionCollection( DesignerOptionService::DesignerOptionCollection^ parent, String^ name, Object^ value )
Parameters
- parent
-
Type:
System.ComponentModel.Design::DesignerOptionService::DesignerOptionCollection^
The parent designer option collection. All collections have a parent except the root object collection.
- name
-
Type:
System::String^
The name of this collection.
- value
-
Type:
System::Object^
The object providing properties for this collection. Can be null if the collection should not provide any properties.
Return Value
Type: System.ComponentModel.Design::DesignerOptionService::DesignerOptionCollection^A new DesignerOptionService::DesignerOptionCollection with the given name.
| Exception | Condition |
|---|---|
| ArgumentNullException | parent or name is null. |
| ArgumentException | name is an empty string. |
The value parameter specifies an object whose public properties are used in the Properties collection of the option collection. The value parameter can be null if this options collection does not offer any properties. Properties are wrapped in such a way that passing anything into the component parameter of the PropertyDescriptor is ignored, and the value object is substituted.
Available since 2.0