AppDomainSetup.AppDomainInitializerArguments プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As AppDomainSetup Dim value As String() value = instance.AppDomainInitializerArguments instance.AppDomainInitializerArguments = value
public: property array<String^>^ AppDomainInitializerArguments { array<String^>^ get (); void set (array<String^>^ value); }
/** @property */ public String[] get_AppDomainInitializerArguments () /** @property */ public void set_AppDomainInitializerArguments (String[] value)
public function get AppDomainInitializerArguments () : String[] public function set AppDomainInitializerArguments (value : String[])
AppDomain の初期化中、AppDomainInitializer デリゲートが表すコールバック メソッドが呼び出されたとき、このコールバック メソッドに渡される文字列の配列。

AppDomain の初期化時に呼び出されるコールバック メソッドを指定するには、AppDomainInitializer プロパティを使用します。このプロパティに代入された配列は、AppDomainInitializer プロパティが設定されなかった場合は使用されません。

次のコード例では、AppDomainSetup オブジェクトと、既定のアプリケーション ドメインから取得した証拠を使用し、ChildDomain という子のアプリケーション ドメインを作成しています。AppDomainInitializer プロパティにコールバック メソッド AppDomainInit を設定し、子のドメインが初期化されたときに呼び出されるようにしています。コールバック メソッドの引数は、文字列の配列として格納し、この配列を AppDomainInitializerArguments プロパティに代入します。子のドメインが作成されると、コールバック メソッドによって、これらの文字列が出力されます。
Imports System Imports System.Security.Policy Public Class Example Public Shared Sub Main() ' Get a reference to the default application domain. ' Dim current As AppDomain = AppDomain.CurrentDomain ' Create the AppDomainSetup that will be used to set up the child ' AppDomain. Dim ads As New AppDomainSetup() ' Use the evidence from the default application domain to ' create evidence for the child application domain. ' Dim ev As Evidence = New Evidence(current.Evidence) ' Create an AppDomainInitializer delegate that represents the ' callback method, AppDomainInit. Assign this delegate to the ' AppDomainInitializer property of the AppDomainSetup object. ' Dim adi As New AppDomainInitializer(AddressOf AppDomainInit) ads.AppDomainInitializer = adi ' Create an array of strings to pass as arguments to the callback ' method. Assign the array to the AppDomainInitializerArguments ' property. Dim initArgs() As String = {"String1", "String2"} ads.AppDomainInitializerArguments = initArgs ' Create a child application domain named "ChildDomain", using ' the evidence and the AppDomainSetup object. ' Dim ad As AppDomain = _ AppDomain.CreateDomain("ChildDomain", ev, ads) Console.WriteLine("Press the Enter key to exit the example program.") Console.ReadLine() End Sub ' The callback method invoked when the child application domain is ' initialized. The method simply displays the arguments that were ' passed to it. ' Public Shared Sub AppDomainInit(ByVal args() As String) Console.WriteLine("AppDomain ""{0}"" is initialized with these arguments:", _ AppDomain.CurrentDomain.FriendlyName) For Each arg As String In args Console.WriteLine(" {0}", arg) Next End Sub End Class ' This code example produces the following output: ' 'AppDomain "ChildDomain" is initialized with these arguments: ' String1 ' String2
using System; using System.Security.Policy; public class Example { public static void Main() { // Get a reference to the default application domain. // AppDomain current = AppDomain.CurrentDomain; // Create the AppDomainSetup that will be used to set up the child // AppDomain. AppDomainSetup ads = new AppDomainSetup(); // Use the evidence from the default application domain to // create evidence for the child application domain. // Evidence ev = new Evidence(current.Evidence); // Create an AppDomainInitializer delegate that represents the // callback method, AppDomainInit. Assign this delegate to the // AppDomainInitializer property of the AppDomainSetup object. // AppDomainInitializer adi = new AppDomainInitializer(AppDomainInit); ads.AppDomainInitializer = adi; // Create an array of strings to pass as arguments to the callback // method. Assign the array to the AppDomainInitializerArguments // property. string[] initArgs = {"String1", "String2"}; ads.AppDomainInitializerArguments = initArgs; // Create a child application domain named "ChildDomain", using // the evidence and the AppDomainSetup object. // AppDomain ad = AppDomain.CreateDomain("ChildDomain", ev, ads); Console.WriteLine("Press the Enter key to exit the example program."); Console.ReadLine(); } // The callback method invoked when the child application domain is // initialized. The method simply displays the arguments that were // passed to it. // public static void AppDomainInit(string[] args) { Console.WriteLine("AppDomain \"{0}\" is initialized with these arguments:", AppDomain.CurrentDomain.FriendlyName); foreach (string arg in args) { Console.WriteLine(" {0}", arg); } } } /* This code example produces the following output: AppDomain "ChildDomain" is initialized with these arguments: String1 String2 */
using namespace System; using namespace System::Security::Policy; public ref class AppDomainInitializerExample { // The callback method invoked when the child application domain is // initialized. The method simply displays the arguments that were // passed to it. // public: static void AppDomainInit(array<String^>^ args) { Console::WriteLine("AppDomain \"{0}\" is initialized with these " + "arguments:", AppDomain::CurrentDomain->FriendlyName); for each (String^ arg in args) { Console::WriteLine(" {0}", arg); } } }; int main() { // Get a reference to the default application domain. // AppDomain^ currentDomain = AppDomain::CurrentDomain; // Create the AppDomainSetup that will be used to set up the child // AppDomain. AppDomainSetup^ domainSetup = gcnew AppDomainSetup(); // Use the evidence from the default application domain to // create evidence for the child application domain. // Evidence^ evidence = gcnew Evidence(currentDomain->Evidence); // Create an AppDomainInitializer delegate that represents the // callback method, AppDomainInit. Assign this delegate to the // AppDomainInitializer property of the AppDomainSetup object. // AppDomainInitializer^ domainInitializer = gcnew AppDomainInitializer(AppDomainInitializerExample::AppDomainInit); domainSetup->AppDomainInitializer = domainInitializer; // Create an array of strings to pass as arguments to the callback // method. Assign the array to the AppDomainInitializerArguments // property. array<String^>^ initialArguments = {"String1", "String2"}; domainSetup->AppDomainInitializerArguments = initialArguments; // Create a child application domain named "ChildDomain", using // the evidence and the AppDomainSetup object. // AppDomain^ appDomain = AppDomain::CreateDomain("ChildDomain", evidence, domainSetup); Console::WriteLine("Press the Enter key to exit the example program."); Console::ReadLine(); } /* This code example produces the following output: AppDomain "ChildDomain" is initialized with these arguments: String1 String2 */

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からAppDomainSetup.AppDomainInitializerArguments プロパティを検索する場合は、下記のリンクをクリックしてください。

- AppDomainSetup.AppDomainInitializerArguments プロパティのページへのリンク