Context Object Types - TechNet Articles - United States (English) - TechNet Wiki

This page is now retired and kept for archival purposes. This programming guide has been published on MSDN at http://msdn.microsoft.com/library/jj860311.aspx

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 ouclass="post-name">Context Object Types

This page is now retired and kept for archival purposes. This programming guide has been published on MSDN at http://msdn.microsoft.com/library/jj860311.aspx

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 tside the console, such as calling 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 ContextObject base class. This class contains two properties, Id, a GUID type that identifies the console object, and Name, a String type that has the name of the object. Depending on the actual derived class the Microsoft.SystemCenter.VirtualMachineManager.UIAddIns.ContextTypes.ContextObject is, it may contain more properties that provide more, although 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 passed to your add-in will always be of ContextObject type. Since the manifest 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