Compartilhar via


Context Object Types

 

Applies To: System Center 2012 SP1

The information in this topic applies only to System Center 2012 SP1.

Any add-in that is invoked by the Virtual Machine Manager (VMM) console is executed in a separate application domain from the console. There is no direct communication from an add-in to the VMM console. However, the console will provide lightweight context objects that provide supply information about what was selected in the console when the add-in was invoked. These context objects will uniquely identify a console object and let you use this information to programmatically work with VMM as you typically would do outside of the console, such as call a Windows PowerShell cmdlet.

The ContextObject base class

The add-in API provides a base class for all context objects that could be passed from the console to the add-in, which is the T:Microsoft.SystemCenter.VirtualMachineManager.UIAddIns.ContextTypes.ContextObject base class. This class contains two properties: Id, which is a T:System.GUID type that identifies the console object; and Name, a String type that has the name of the object. Depending on the actual class that the T:Microsoft.SystemCenter.VirtualMachineManager.UIAddIns.ContextTypes.ContextObject is derived from, it can contain more properties that provide more basic information about the object.

A user may select one or more items in the console, and if your add-in is invoked, a list of context objects will be passed to your add-in. The list of context objects that will be passed to your add-in will always be of T:Microsoft.SystemCenter.VirtualMachineManager.UIAddIns.ContextTypes.ContextObject type. Since the manifest file of your add-in can be configured to display your add-in button or view on different types of objects, you will have to determine which derived class your context objects are actually.

Derived context objects

The following list describes the supported object types that the VMM console can send to an add-in as a context object:

  • Managed Computer types

    • HostContext

    • ClusterContext

  • Virtualization types

    • HostGroupContext

    • CloudContext

    • VMContext

    • ServiceContext

  • Storage types

    • StorageClassificationContext

    • StorageProviderContext

    • StorageArrayContext

    • StoragePoolContext

    • StorageLogicalUnitContext

  • Networking types

    • LogicalNetworkContext

    • LoadBalancerContext

    • MacAddressPoolContext

    • VipTemplateContext

    • IpPoolContext

See Also

Architecture Concepts
Manifests
Base Classes