You can use icons with Microsoft System Center Configuration Manager 2007 console actions, nodes, queries, and objects. The icons can be static, or the Configuration Manager 2007 console can dynamically display an icon based on the result of a method you implement. You can also display an icon based on the value of a Configuration Manager object property.
The ImagesDescription element is used to describe an icon. The following XML describes an executable action that uses an icon called WebNavigation.
Copy Code | |
---|---|
<ActionDescription Class="Executable" DisplayName="GiveFeedbackMenuItem" MnemonicDisplayName="GiveFeedbackMnemonic" Description="GiveFeedbackMenuItemDescription"> <ResourceAssembly> <Assembly>Microsoft.ConfigurationManagement.dll</Assembly> <Type>Microsoft.ConfigurationManagement.AdminConsole.Properties.Resources.resources</Type> </ResourceAssembly> <ImagesDescription> <ResourceAssembly> <Assembly>AdminUI.UIResources.dll</Assembly> <Type>Microsoft.ConfigurationManagement.AdminConsole.UIResources.Properties.Resources.resources</Type> </ResourceAssembly> <ImageResourceName>WebNavigation</ImageResourceName> </ImagesDescription> <Executable> <FilePath>http://go.microsoft.com/fwlink/?LinkId=67307</FilePath> </Executable> </ActionDescription> |
Static Icons
Static icons are loaded from a resource you specify in the ResourceAssembly element. The ResourceAssembly element specifies the icon in the resource to use. The preceding XML example shows a static icon being used.
Dynamic Icons
The Configuration Manager console can determine which icon to display by calling a method in an assembly that you define. The signature for the method you implement is:
public static bool GetIcon(object sender,
ScopeNode scopeNode, IResultObject resultObject, out
AssemblyDescription resourceAssembly)
If the method returns true, the Configuration Manager console uses the icon you return in an Microsoft.ConfigurationManagement.AdminConsole.Schema.AssemblyDescription object. AssemblyDescription contains information about the resource assembly that contains the icon to be displayed.
If the method returns false, the Configuration Manager console uses the default icon for the object. The ExternalImage element defines the method to be called and the ResourceAssembly element defines the assembly where the method is implemented. The following XML shows the GetSiteIcon method that is being used to get an icon.
Copy Code | |
---|---|
<ImagesDescription> <ExternalImage> <Assembly>AdminUI.SiteSystems.dll</Assembly> <Type>Microsoft.ConfigurationManagement.AdminConsole.SiteSystems.DisplayUtilities</Type> <Method>GetSiteIcon</Method> </ExternalImage> <ResourceAssembly> <Assembly>AdminUI.UIResources.dll</Assembly> <Type>Microsoft.ConfigurationManagement.AdminConsole.UIResources.Properties.Resources.resources</Type> </ResourceAssembly> <ImageResourceName>SecondarySite</ImageResourceName> </ImagesDescription> |
Icon Alias
You can show an icon that is based on the value of an object property by using the AliasProperty attribute of the ImagesDescription element. The Configuration Manager console evaluates the value of the object property and loads the appropriate icon. In the following XML, the alias property is OwnedBySite, which is a property of SMS_Collection. The property value can be true or false. Correspondingly, there is an icon resource for CollectionsIcon that includes two icons appropriate for true and false values. If, during evaluation, OwnedBySite is true, the owned by site icon is displayed; otherwise the not owned by site icon is displayed.
<ImagesDescription AliasProperty="
OwnedByThisSite
">
<ResourceAssembly>
<Assembly>AdminUI.UIResources.dll</Assembly>
<Type>Microsoft.ConfigurationManagement.AdminConsole.UIResources.Properties.Resources.resources</Type>
</ResourceAssembly>
<AliasResourceAssembly>
<Assembly>AdminUI.UIResources.dll</Assembly>
<Type>Microsoft.ConfigurationManagement.AdminConsole.UIResources.SMS_Collection-OwnedByThisSite.resources</Type>
</AliasResourceAssembly>
<ImageResourceName>
CollectionsIcon
</ImageResourceName>
</ImagesDescription>
See Also
Send comments about this topic to Microsoft.