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.
This API is not CLS-compliant.
Assembly: Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
'Declaration <ComVisibleAttribute(True)> _ <CLSCompliantAttribute(False)> _ Public Class DialogPage _ Inherits Component _ Implements IWin32Window, IProfileManager
[ComVisibleAttribute(true)] [CLSCompliantAttribute(false)] public class DialogPage : Component, IWin32Window, IProfileManager
[ComVisibleAttribute(true)] [CLSCompliantAttribute(false)] public ref class DialogPage : public Component, IWin32Window, IProfileManager
[<ComVisibleAttribute(true)>] [<CLSCompliantAttribute(false)>] type DialogPage = class inherit Component interface IWin32Window interface IProfileManager end
public class DialogPage extends Component implements IWin32Window, IProfileManager
The DialogPage type exposes the following members.
|DialogPage||Initializes a new instance of DialogPage.|
|AutomationObject||Gets the DTE automation model object for a given instance of a dialog page class.|
|CanRaiseEvents||Gets a value indicating whether the component can raise an event. (Inherited from Component.)|
|Container||Gets the IContainer that contains the Component. (Inherited from Component.)|
|DesignMode||Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)|
|Events||Gets the list of event handlers that are attached to this Component. (Inherited from Component.)|
|SettingsRegistryPath||Gets or sets the sub-key under the Visual Studio version-specific root for storing settings data for a dialog page.|
|Site||Gets or sets the site of the dialog page. Overrides the implementation inherited from Component. (Overrides Component.Site.)|
|Window||Gets the window that is used as the user interface of the dialog page.|
|CreateObjRef||Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)|
|Dispose()||Releases all resources used by the Component. (Inherited from Component.)|
|Dispose(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).)|
|Equals||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetLifetimeService||Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)|
|GetService||Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|InitializeLifetimeService||Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)|
|LoadSettingsFromStorage||Called by Visual Studio to load the settings of a dialog page from local storage, generally the registry.|
|LoadSettingsFromXml||Called by Visual Studio to load the settings of a dialog page from the Visual Studio settings storage on disk.|
|MemberwiseClone()||Creates a shallow copy of the current Object. (Inherited from Object.)|
|MemberwiseClone(Boolean)||Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)|
|OnActivate||Handles Windows Activate messages from the Visual Studio environment.|
|OnApply||Handles Apply messages from the Visual Studio environment.|
|OnClosed||Handles Close messages from the Visual Studio environment.|
|OnDeactivate||Handles Deactive messages from the Visual Studio environment.|
|ResetSettings||Should be overridden to reset settings to their default values.|
|SaveSettingsToStorage||Called by Visual Studio to store the settings of a dialog page in local storage, typically the registry.|
|SaveSettingsToXml||Called by Visual Studio to store the settings of a dialog page to the Visual Studio settings storage on disk.|
|ToString||Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)|
|Disposed||Occurs when the component is disposed by a call to the Dispose method. (Inherited from Component.)|
Explicit Interface Implementations
|IWin32Window.Handle||Gets the handle of the window of the dialog page.|
Notes for Implementers
Implement classes derived from DialogPage when you create a user dialog box, especially a Tools Options page or a Toolbox property page.
Notes for Callers
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.
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.
For an object derived from DialogPage to provide persistence, it must be registered by using ProvideProfileAttribute.
Types derived from DialogPage inherit a default persistence implementation of IProfileManager.
The default implementation persists all public properties of the automation object of the dervied class, which is the object that is returned by AutomationObject and that supports conversion to and from strings through TypeConverter.
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.
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.
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.