DialogPage Class

 

Provides a standard dialog box functionality for implementing Toolbox property sheets, Tools Options pages, or custom UI dialog boxes, with support for the Visual Studio automation model, Windows Forms, and state persistence by using the Visual Studio settings mechanism.

Namespace:   Microsoft.VisualStudio.Shell
Assembly:  Microsoft.VisualStudio.Shell.14.0 (in Microsoft.VisualStudio.Shell.14.0.dll)


[ComVisibleAttribute(true)]
public class DialogPage : Component, IWin32Window, IProfileManager

NameDescription
System_CAPS_pubmethodDialogPage()

Initializes a new instance of DialogPage.

NameDescription
System_CAPS_pubpropertyAutomationObject

Gets the DTE automation model object for a given instance of a dialog page class.

System_CAPS_protpropertyCanRaiseEvents

(Inherited from Component.)

System_CAPS_pubpropertyContainer

(Inherited from Component.)

System_CAPS_protpropertyDesignMode

(Inherited from Component.)

System_CAPS_protpropertyEvents

(Inherited from Component.)

System_CAPS_protpropertySettingsRegistryPath

Gets or sets the sub-key under the Visual Studio version-specific root for storing settings data for a dialog page.

System_CAPS_protpropertySharedSettingsStorePath

Gets the location where the settings are stored in the shared settings store. It's based on the SharedSettingsAttribute on your AutomationObject, or the full type name if the attribute is not specified.

System_CAPS_pubpropertySite

Gets or sets the site of the dialog page. Overrides the implementation inherited from Component.(Overrides Component.Site.)

System_CAPS_protpropertyWindow

Gets the window that is used as the user interface of the dialog page.

NameDescription
System_CAPS_pubmethodCreateObjRef(Type)

(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDispose()

(Inherited from Component.)

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources that are used by a dialog page class and optionally releases the managed resources; the parent class, Component supports unmanaged resources.(Overrides Component.Dispose(Boolean).)

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Component.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_protmethodGetService(Type)

(Inherited from Component.)

System_CAPS_protmethodGetSharedSettingsStorePath(PropertyDescriptor)

Gets the shared settings store path for the given property.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

(Inherited from MarshalByRefObject.)

System_CAPS_protmethodIsPropertyValueMachineLocal(PropertyDescriptor, Object, String)

Determine whether a given value from a property on the AutomationObject is local to this machine (vs. being roamable to other machines),

System_CAPS_pubmethodLoadSettingsFromStorage()

Called by Visual Studio to load the settings of a dialog page from local storage, generally the registry.

System_CAPS_pubmethodLoadSettingsFromXml(IVsSettingsReader)

Called by Visual Studio to load the settings of a dialog page from the Visual Studio settings storage on disk.

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone(Boolean)

(Inherited from MarshalByRefObject.)

System_CAPS_protmethodOnActivate(CancelEventArgs)

Handles Windows Activate messages from the Visual Studio environment.

System_CAPS_protmethodOnApply(DialogPage.PageApplyEventArgs)

Handles Apply messages from the Visual Studio environment.

System_CAPS_protmethodOnClosed(EventArgs)

Handles Close messages from the Visual Studio environment.

System_CAPS_protmethodOnDeactivate(CancelEventArgs)

Handles Deactive messages from the Visual Studio environment.

System_CAPS_pubmethodResetSettings()

Should be overridden to reset settings to their default values.

System_CAPS_pubmethodSaveSettingsToStorage()

Called by Visual Studio to store the settings of a dialog page in local storage, typically the registry.

System_CAPS_pubmethodSaveSettingsToXml(IVsSettingsWriter)

Called by Visual Studio to store the settings of a dialog page to the Visual Studio settings storage on disk.

System_CAPS_pubmethodToString()

(Inherited from Component.)

NameDescription
System_CAPS_pubeventDisposed

(Inherited from Component.)

Implement classes derived from DialogPage when you create a user dialog box, especially a Tools Options page or a Toolbox property page.

The simplest implementation of DialogPage requires only the definition of public properties on the implementing class. The property types must support conversion to and from strings through TypeConverter.

The base implementation of DialogPage provides default handlers for standard windows events, and implements the Component, IWin32Window, and IProfileManager.

Classes derived from DialogPage have the following:

  • Automatic support for component sharing through the Visual Studio DTE automation object model.

    • Any instance of DialogPage is an automation object, because the class inherits the Component interface implementation.

    • Applications that must access the automation object of the class use the AutomationObject property.

      The AutomationObject property returns this (Me in Visual Basic), because the implementation of DialogPage is already an automation object by default.

    • An implementation of DialogPage can offer an automation object other than itself by overriding the base AutomationObject implementation. For example, this might be done to provide separate user interface and the object models.

  • Support for the Visual Studio settings mechanism, based on the public properties of the automation object of the derived class.

  • A default user interface that is based on the public properties of the automation object of the derived class.

    • For a dialog page implementation to provide a Tools Options page, it must be registered by using ProvideOptionPageAttribute.

    • For a dialog page implementation to provide a Toolbox dialog page, it must be registered by using ProvideToolboxPageAttribute.

    • Dialog pages use Window to return a IWin32Window, which provides a handle to the window that provides the user interface of the class.

    • By default, the window that is referenced by Window is a property grid, which is implemented by an instance of PropertyGrid by selecting the automation object.

    • The DialogPage base class uses its implementation of AutomationObject to obtain the automation object of the class and the public properties of that automation object.

    • Changes to public properties made through the user interface of a dialog page are automatically saved to local storage (typically the registry) by a call to the SaveSettingsToStorage method.

    • A dialog page implementation can change its user interface by overriding Window.

System_CAPS_noteNote

Typically, an instance of a dialog page class is its own automation object. Therefore, properties that are persisted or displayed are those of the class that is derived from DialogPage. However, if AutomationObject returns another object, it is that object's properties, not the class's, that are persisted or displayed.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: