AppDomain.IsDefaultAppDomain メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > AppDomain.IsDefaultAppDomain メソッドの意味・解説 

AppDomain.IsDefaultAppDomain メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

アプリケーション ドメインが、プロセス既定アプリケーション ドメインであるかどうかを示す値を返します

名前空間: System
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

解説解説
使用例使用例

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
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からAppDomain.IsDefaultAppDomain メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からAppDomain.IsDefaultAppDomain メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からAppDomain.IsDefaultAppDomain メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

AppDomain.IsDefaultAppDomain メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



AppDomain.IsDefaultAppDomain メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS