SnapIn Class
Provides the main entry point for the creation of a snap-in.
Namespace: Microsoft.ManagementConsole
Assembly: Microsoft.ManagementConsole (in Microsoft.ManagementConsole.dll)
Inheritance Hierarchy
System.Object
Microsoft.ManagementConsole.SnapInBase
Microsoft.ManagementConsole.NamespaceSnapInBase
Microsoft.ManagementConsole.SnapIn
Syntax
public abstract class SnapIn : NamespaceSnapInBase
public ref class SnapIn abstract : NamespaceSnapInBase
[<AbstractClass>]
type SnapIn =
class
inherit NamespaceSnapInBase
end
Public MustInherit Class SnapIn
Inherits NamespaceSnapInBase
Constructors
Name | Description | |
---|---|---|
SnapIn() | Initializes a new instance of the SnapIn class. |
Properties
Name | Description | |
---|---|---|
Console | Gets the console object that exposes the functionality of the main MMC console window. (Inherited from NamespaceSnapInBase.) |
|
Id | Gets the identifier for the instance of the snap-in. The identifier is unique across snap-in instances within a console. (Inherited from SnapInBase.) |
|
InvokeRequired | Gets a value that indicates whether the caller must call the Invoke or the BeginInvoke methods when calling a method on a snap-in component. This distinction is necessary when the caller is on a different thread than the thread that the snap-in was created on. (Inherited from SnapInBase.) |
|
IsModified | Gets or sets a flag that tells the MMC runtime whether the snap-in has data that needs to be saved. (Inherited from NamespaceSnapInBase.) |
|
LargeImages | Gets the list of 32 x 32 images for the snap-in and its elements. (Inherited from NamespaceSnapInBase.) |
|
RootNode | Gets or sets the root of the scope namespace for the snap-in. |
|
SmallImages | Gets the list of 16 x 16 images for the snap-in and its elements. (Inherited from NamespaceSnapInBase.) |
|
Tag | Gets or sets an object that contains application-specific information that is associated with the snap-in.(Inherited from SnapInBase.) |
Methods
Name | Description | |
---|---|---|
BeginInvoke(Delegate) | Executes the specified delegate asynchronously on the thread that the snap-in was created on.(Inherited from SnapInBase.) |
|
BeginInvoke(Delegate, Object[]) | Executes the specified delegate with its specified arguments on the main thread that the snap-in was created on. (Inherited from SnapInBase.) |
|
EndInvoke(IAsyncResult) | Waits until the process that was started by calling BeginInvoke completes. This method then retrieves the return value of the asynchronous operation identified by the result parameter. (Inherited from SnapInBase.) |
|
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetHashCode() | (Inherited from Object.) |
|
GetType() | (Inherited from Object.) |
|
Invoke(Delegate) | Executes the delegate on the main thread that the snap-in executes on. (Inherited from SnapInBase.) |
|
Invoke(Delegate, Object[]) | Executes the delegate on the main thread that the snap-in executes on. (Inherited from SnapInBase.) |
|
MemberwiseClone() | (Inherited from Object.) |
|
OnInitialize() | Called when a snap-in is initialized. It allows derived classes to provide additional initialization. (Inherited from SnapInBase.) |
|
OnLoadCustomData(AsyncStatus, Byte[]) | Passes data that is contained in the console file to the snap-in. (Inherited from NamespaceSnapInBase.) |
|
OnSaveCustomData(SyncStatus) | Retrieves a serializable object that the snap-in can persist into a binary section in the console file. (Inherited from NamespaceSnapInBase.) |
|
OnShowInitializationWizard() | Shows an initialization wizard or dialog for the Add/Remove wizard by calling the ShowDialog method. |
|
OnShutdown(AsyncStatus) | Called when the snap-in is shutting down. Once this call returns, actions which modify the console, such as adding nodes, or modifying view descriptions, are not honored. (Inherited from SnapInBase.) |
|
RegisterCurrentThreadForUI() | Called on a background thread to register it as a candidate for showing pop-up UI. (Inherited from SnapInBase.) |
|
ShowHelpTopic(String) | Displays a help topic. (Inherited from SnapInBase.) |
|
ToString() | (Inherited from Object.) |
|
UnregisterCurrentThreadForUI() | Called on a background thread to unregister it as a candidate for showing pop-up UI. (Inherited from SnapInBase.) |
|
UpdateSnapInExtensions() | Updates MMC's internal cache of available extensions for the snap-in. (Inherited from NamespaceSnapInBase.) |
Remarks
In the managed framework in MMC, a minimal amount of code that uses this class is required to build a simple snap-in that has core functionality. The NamespaceSnapInBase class from which the SnapIn class is derived, provides an implementation of functionality that is common to both standalone snap-ins and extension snap-ins. The SnapIn class provides an abstraction for the following three types of information:
Registration: Registration information for a snap-in is provided through the use of attributes of the snap-in derived class and its nodes. In particular, for the derived class, the attributes specify the following information:
About: This contains items such as the name and the description. This information is added to the registry and used within MMC in the Add/Remove Programs dialog. This information allows the user to avoid loading and initializing the snap-in when the snap-in is only being browsed.
Extension: The snap-in may be extended by another snap-in. Attributes are used to specify the node types that can be extended
Scope namespace root: Every standalone snap-in must have a node that represents the scope namespace root of the snap-in. This node is exposed as the RootNode property of the SnapIn class. The scope namespace is manipulated by adding and removing nodes from the collection of child scope nodes in the tree.
Global snap-in: The SnapIn class has two member properties that are image lists. The SmallImages and LargeImages properties represent 16 x 16 and 32 x 32 images, respectively, of all the UI elements in the snap-in. Any MMC API that uses images needs an index of these two image lists. It is the responsibility of the snap-in developer to ensure that for every 16 x 16 image there is a corresponding 32 x 32 image. The list can be updated dynamically.
Note — The SmallImages and LargeImages properties are read-only in that you can only retrieve the instance of the image list. However, this does not preclude you from modifying the contents of the image lists by using the methods that are available in the SnapInImageList class.
Thread Safety
Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also
Microsoft.ManagementConsole Namespace
Return to top