AssemblyType
アクションは、Configuration Manager コンソールによって呼び出されるメソッドの型とアセンブリを定義します。
注:
このトピックの XML および C# コードは、Configuration Manager SDK のダイアログ プロトタイプ サンプルで入手できます。
次の属性と要素は、アセンブリ内のメソッドを呼び出すアクションに固有です。
ActionDescription
要素のClass
属性は、AssemblyType
に設定されます。ActionAssembly
要素には、メソッドとアセンブリの定義に使用される子要素が多数あります。Assembly
要素は、 メソッドを含むアセンブリを識別します。 アセンブリが %ProgramFiles%\Microsoft Endpoint Manager\AdminConsole\bin フォルダー以外のフォルダーにある場合は、Assembly
要素にアセンブリ ファイル名とファイルへの完全なパスを含める必要があります。Type
要素には、 メソッドの名前空間とクラスが含まれています。Method
要素には、呼び出すメソッドの名前が含まれています。
メソッド
メソッドシグネチャは次のとおりです。
public static void Method(object, ScopeNode, ActionDescription, IResultObject, PropertyDataUpdated, Status)
パラメーターは次のとおりです。
object
メソッドを呼び出す オブジェクト。
ScopeNode
アクションが呼び出されたときにアクティブだったConfiguration Managerコンソール ノード。
ActionDescription
アクションを開始した ActionDescription
クラス インスタンス。
IResultObject
選択したオブジェクト、または選択したオブジェクトがない場合は null
。
PropertyDataUpdated
Configuration Manager コンソール ビューの更新情報を提供するために開くデリゲート。
Status
Configuration Managerコンソールビジー状態インジケーターの制御を許可します。
実装例
メソッドの実装例を次に示します。
public static void Method(object sender, ScopeNode scopeNode, ActionDescription action, IResultObject resultObject, PropertyDataUpdated dataUpdatedDelegate, Status status)
{
if (resultObject != null)
{
MessageBox.Show(string.Format("The {0} package was selected", resultObject["Name"].StringValue));
}
else
{
MessageBox.Show("No package was selected");
}
}
AssemblyType Action XML
次の XML 例では、 Method
メソッドをクラス SampleClass
で呼び出す方法を示します。 メソッドはアセンブリ AdminUI.PrototypeDialog.dll
にあります。
<ActionDescription Class="AssemblyType" DisplayName="Test Action (method)" MnemonicDisplayName="Mnemonic" Description="Description">
<ShowOn>
<string>DefaultHomeTab</string>
<string>ContextMenu</string>
</ShowOn>
<ActionAssembly>
<Assembly>AdminUI.PrototypeDialog.dll</Assembly>
<Type>Microsoft.ConfigurationManagement.AdminConsole.PrototypeDialog.ExampleClass</Type>
<Method>Method</Method>
<!--Method signature: public static void Method(object sender, ScopeNode scopeNode, ActionDescription action, IResultObject resultObject, PropertyDataUpdated dataUpdatedDelegate, Status status)-->
</ActionAssembly>
</ActionDescription>
関連項目
Configuration Manager アクションConfiguration ManagerアクションConfiguration Managerアクション XML を作成する方法 Configuration Manager ノード GUID を検索する方法