AppDomain.IsDefaultAppDomain メソッド
アセンブリ: mscorlib (mscorlib.dll 内)

Dim instance As AppDomain Dim returnValue As Boolean returnValue = instance.IsDefaultAppDomain
現在の AppDomain オブジェクトがプロセスの既定のアプリケーション ドメインを表す場合は true。それ以外の場合は false。


2 つ目のアプリケーション ドメインを作成し、既定のドメインの情報と新しいドメインの情報を表示するコード例を次に示します。
Imports System Imports System.Reflection Public Class Example ' The following attribute indicates to the loader that assemblies ' in the global assembly cache should be shared across multiple ' application domains. <LoaderOptimizationAttribute(LoaderOptimization.MultiDomainHost)> _ Public Shared Sub Main() ' Show information for the default application domain. ShowDomainInfo() ' Create a new application domain and display its information. Dim newDomain As AppDomain = AppDomain.CreateDomain("MyMultiDomain") newDomain.DoCallBack(AddressOf ShowDomainInfo) End Sub 'Main ' This method has the same signature as the CrossAppDomainDelegate , ' so that it can be executed easily in the new application domain. ' Public Shared Sub ShowDomainInfo() Dim ad As AppDomain = AppDomain.CurrentDomain Console.WriteLine() Console.WriteLine("FriendlyName: {0}", ad.FriendlyName) Console.WriteLine("Id: {0}", ad.Id) Console.WriteLine("IsDefaultAppDomain: {0}", ad.IsDefaultAppDomain()) End Sub End Class
using System; using System.Reflection; public class Example { // The following attribute indicates to the loader that assemblies // in the global assembly cache should be shared across multiple // application domains. [LoaderOptimizationAttribute( LoaderOptimization.MultiDomainHost)] public static void Main() { // Show information for the default application domain. ShowDomainInfo(); // Create a new application domain and display its information. AppDomain newDomain = AppDomain.CreateDomain("MyMultiDomain"); newDomain.DoCallBack(new CrossAppDomainDelegate(ShowDomainInfo)); } // This method has the same signature as the CrossAppDomainDelegate , // so that it can be executed easily in the new application domain. // public static void ShowDomainInfo() { AppDomain ad = AppDomain.CurrentDomain; Console.WriteLine(); Console.WriteLine("FriendlyName: {0}", ad.FriendlyName); Console.WriteLine("Id: {0}", ad.Id); Console.WriteLine("IsDefaultAppDomain: {0}", ad.IsDefaultAppDomain()); } }
using namespace System; using namespace System::Reflection; // This method has the same signature as the CrossAppDomainDelegate , // so that it can be executed easily in the new application domain. // static void ShowDomainInfo() { AppDomain^ ad = AppDomain::CurrentDomain; Console::WriteLine(); Console::WriteLine( L"FriendlyName: {0}", ad->FriendlyName ); Console::WriteLine( L"Id: {0}", ad->Id ); Console::WriteLine( L"IsDefaultAppDomain: {0}", ad->IsDefaultAppDomain() ); } // The following attribute indicates to the loader that assemblies // in the global assembly cache should be shared across multiple // application domains. // [LoaderOptimizationAttribute(LoaderOptimization::MultiDomainHost)] int main() { // Show information for the default application domain. ShowDomainInfo(); // Create a new application domain and display its information. AppDomain^ newDomain = AppDomain::CreateDomain( L"MyMultiDomain" ); newDomain->DoCallBack( gcnew CrossAppDomainDelegate( ShowDomainInfo ) ); return 0; }
import System.*; import System.Reflection.*; public class Example { // The following attribute indicates to the loader that assemblies // in the global assembly cache should be shared across multiple // application domains. /** @attribute LoaderOptimizationAttribute( LoaderOptimization.MultiDomainHost) */ public static void main(String[] args) { // Show information for the default application domain. ShowDomainInfo(); // Create a new application domain and display its information. AppDomain newDomain = AppDomain.CreateDomain("MyMultiDomain"); newDomain.DoCallBack(new CrossAppDomainDelegate(ShowDomainInfo)); } //main // This method has the same signature as the CrossAppDomainDelegate , // so that it can be executed easily in the new application domain. // public static void ShowDomainInfo() { AppDomain ad = AppDomain.get_CurrentDomain(); Console.WriteLine(); Console.WriteLine("FriendlyName: {0}", ad.get_FriendlyName()); Console.WriteLine("Id: {0}", (Int32)ad.get_Id()); Console.WriteLine("IsDefaultAppDomain: {0}", (System.Boolean)ad.IsDefaultAppDomain()); } //ShowDomainInfo } //Example

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に収録されているすべての辞書からAppDomain.IsDefaultAppDomain メソッドを検索する場合は、下記のリンクをクリックしてください。

- AppDomain.IsDefaultAppDomain メソッドのページへのリンク