System.ComponentModel.Design.DesignerOptionService Class

Provides a base class for getting and setting option values for a designer.

See Also: DesignerOptionService Members

Syntax

public abstract class DesignerOptionService : IDesignerOptionService

Remarks

The System.ComponentModel.Design.DesignerOptionService class provides a collection of options. Each of these option collections has an indexer that enables it to be further filtered. Each option collection contains its own set of options, as well as a rollup of all of its child options. In the event of a naming conflict between properties, the outermost options object takes precedence. The following Tools | Options user interface (UI) structure shows how the outermost options object takes on greater importance:

WindowsFormsDesigner | General

Given a System.ComponentModel.Design.IDesignerOptionService named service, to get to the value of the System.Windows.Forms.Design.ParentControlDesigner.GridSize property, you would make the following call:

code reference: IDesignerOptionServiceExample#2

This works, until you want to move System.Windows.Forms.Design.ParentControlDesigner.GridSize to another page. Also, System.ComponentModel.Design.IDesignerOptionService provides no discovery mechanism. If you do not know what string to pass in, the service cannot find the property value.

The System.ComponentModel.Design.DesignerOptionService class addresses these issues. You can query collections, and there is a type converter defined on the System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection object that marks the collection as expandable. With this type converter, you can pass the entire designer option service to a property window and visually inspect the service.

Requirements

Namespace: System.ComponentModel.Design
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0