次の方法で共有


AssemblyFlagsAttribute コンストラクター

定義

AssemblyFlagsAttribute クラスの新しいインスタンスを初期化します。

オーバーロード

AssemblyFlagsAttribute(Int32)
古い.
古い.
古い.

整数値としてキャストされている AssemblyFlagsAttribute フラグの組み合わせを指定して、AssemblyNameFlags クラスの新しいインスタンスを初期化します。

AssemblyFlagsAttribute(AssemblyNameFlags)

AssemblyFlagsAttribute フラグの組み合わせを指定して AssemblyNameFlags クラスの新しいインスタンスを初期化します。

AssemblyFlagsAttribute(UInt32)
古い.
古い.
古い.

符号なし整数値としてキャストされている AssemblyFlagsAttribute フラグの組み合わせを指定して、AssemblyNameFlags クラスの新しいインスタンスを初期化します。

AssemblyFlagsAttribute(Int32)

ソース:
AssemblyFlagsAttribute.cs
ソース:
AssemblyFlagsAttribute.cs
ソース:
AssemblyFlagsAttribute.cs

注意事項

This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. https://go.microsoft.com/fwlink/?linkid=14202

注意事項

This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.

注意事項

This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202

整数値としてキャストされている AssemblyFlagsAttribute フラグの組み合わせを指定して、AssemblyNameFlags クラスの新しいインスタンスを初期化します。

public:
 AssemblyFlagsAttribute(int assemblyFlags);
[System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public AssemblyFlagsAttribute (int assemblyFlags);
[System.Obsolete("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")]
public AssemblyFlagsAttribute (int assemblyFlags);
[System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public AssemblyFlagsAttribute (int assemblyFlags);
public AssemblyFlagsAttribute (int assemblyFlags);
[<System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Reflection.AssemblyFlagsAttribute : int -> System.Reflection.AssemblyFlagsAttribute
[<System.Obsolete("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")>]
new System.Reflection.AssemblyFlagsAttribute : int -> System.Reflection.AssemblyFlagsAttribute
[<System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Reflection.AssemblyFlagsAttribute : int -> System.Reflection.AssemblyFlagsAttribute
new System.Reflection.AssemblyFlagsAttribute : int -> System.Reflection.AssemblyFlagsAttribute
Public Sub New (assemblyFlags As Integer)

パラメーター

assemblyFlags
Int32

Just-In-Time (JIT) コンパイラのオプション、有効期限、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キーとトークン化された公開キーのどちらを保有しているのかを示す、整数値としてキャストされた AssemblyNameFlags フラグのビットごとの組み合わせ。

属性

注釈

この型指定されていないコンストラクターは廃止されました。 使用しないでください。

適用対象

AssemblyFlagsAttribute(AssemblyNameFlags)

ソース:
AssemblyFlagsAttribute.cs
ソース:
AssemblyFlagsAttribute.cs
ソース:
AssemblyFlagsAttribute.cs

AssemblyFlagsAttribute フラグの組み合わせを指定して AssemblyNameFlags クラスの新しいインスタンスを初期化します。

public:
 AssemblyFlagsAttribute(System::Reflection::AssemblyNameFlags assemblyFlags);
public AssemblyFlagsAttribute (System.Reflection.AssemblyNameFlags assemblyFlags);
new System.Reflection.AssemblyFlagsAttribute : System.Reflection.AssemblyNameFlags -> System.Reflection.AssemblyFlagsAttribute
Public Sub New (assemblyFlags As AssemblyNameFlags)

パラメーター

assemblyFlags
AssemblyNameFlags

Just-In-Time (JIT) コンパイラのオプション、有効期限、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キーとトークン化された公開キーのどちらを保有しているのかを示す AssemblyNameFlags フラグの、ビットごとの組み合わせ。

次のコード例は、 をアセンブリに適用 AssemblyFlagsAttribute する方法と、実行時にフラグを読み取る方法を示しています。 この例では、 属性のインスタンスも作成し、 プロパティを AssemblyFlags 使用してフラグを表示します。 動的アセンブリに を適用 AssemblyFlagsAttribute する方法の例については、 プロパティを AssemblyName.Flags 参照してください。

using namespace System;
using namespace System::Reflection;

// Specify a combination of AssemblyNameFlags for this
// assembly.
[assembly:AssemblyFlagsAttribute(
     AssemblyNameFlags::EnableJITcompileOptimizer
   | AssemblyNameFlags::Retargetable)];

public ref class Example
{
public:
   static void Main()
   {
      // Get this assembly.
      Assembly^ thisAsm = Example::typeid->Assembly;
      
      // Get the AssemblyName for this assembly.
      AssemblyName^ thisAsmName = thisAsm->GetName( false );
      
      // Display the flags that were set for this assembly.
      ListFlags( thisAsmName->Flags );
      
      // Create an instance of AssemblyFlagsAttribute with the
      // same combination of flags that was specified for this
      // assembly. Note that PublicKey is included automatically
      // for the assembly, but not for this instance of
      // AssemblyFlagsAttribute.
      AssemblyFlagsAttribute^ afa = gcnew AssemblyFlagsAttribute( 
         static_cast<AssemblyNameFlags> (AssemblyNameFlags::EnableJITcompileOptimizer
                                       | AssemblyNameFlags::Retargetable) );
      
      // Get the flags. The property returns an integer, so
      // the return value must be cast to AssemblyNameFlags.
      AssemblyNameFlags anf = static_cast<AssemblyNameFlags>(afa->AssemblyFlags);
      
      // Display the flags.
      Console::WriteLine();
      ListFlags( anf );
   }

private:
   static void ListFlags( AssemblyNameFlags anf )
   {
      if ( anf == AssemblyNameFlags::None )
      {
         Console::WriteLine( L"AssemblyNameFlags.None" );
      }
      else
      {
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::Retargetable) )
                  Console::WriteLine( L"AssemblyNameFlags.Retargetable" );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::PublicKey) )
                  Console::WriteLine( L"AssemblyNameFlags.PublicKey" );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::EnableJITcompileOptimizer) )
                  Console::WriteLine( L"AssemblyNameFlags.EnableJITcompileOptimizer" );
         if ( 0 != static_cast<Int32>(anf & AssemblyNameFlags::EnableJITcompileTracking) )
                  Console::WriteLine( L"AssemblyNameFlags.EnableJITcompileTracking" );
      }
   }

};

int main()
{
   Example::Main();
}

/* This code example produces the following output:

AssemblyNameFlags.Retargetable
AssemblyNameFlags.PublicKey
AssemblyNameFlags.EnableJITcompileOptimizer

AssemblyNameFlags.Retargetable
AssemblyNameFlags.EnableJITcompileOptimizer
*/
using System;
using System.Reflection;

// Specify a combination of AssemblyNameFlags for this
// assembly.
[assembly:AssemblyFlagsAttribute(
    AssemblyNameFlags.EnableJITcompileOptimizer |
    AssemblyNameFlags.Retargetable)]

public class Example
{
    public static void Main()
    {
        // Get this assembly.
        Assembly thisAsm = typeof(Example).Assembly;

        // Get the AssemblyName for this assembly.
        AssemblyName thisAsmName = thisAsm.GetName(false);

        // Display the flags that were set for this assembly.
        ListFlags(thisAsmName.Flags);

        // Create an instance of AssemblyFlagsAttribute with the
        // same combination of flags that was specified for this
        // assembly. Note that PublicKey is included automatically
        // for the assembly, but not for this instance of
        // AssemblyFlagsAttribute.
        AssemblyFlagsAttribute afa = new AssemblyFlagsAttribute(
            AssemblyNameFlags.EnableJITcompileOptimizer |
            AssemblyNameFlags.Retargetable);

        // Get the flags. The property returns an integer, so
        // the return value must be cast to AssemblyNameFlags.
        AssemblyNameFlags anf = (AssemblyNameFlags) afa.AssemblyFlags;

        // Display the flags.
        Console.WriteLine();
        ListFlags(anf);
    }

    private static void ListFlags(AssemblyNameFlags anf)
    {
        if (anf == AssemblyNameFlags.None)
        {
            Console.WriteLine("AssemblyNameFlags.None");
        }
        else
        {
            if (0!=(anf & AssemblyNameFlags.Retargetable))
                Console.WriteLine("AssemblyNameFlags.Retargetable");
            if (0!=(anf & AssemblyNameFlags.PublicKey))
                Console.WriteLine("AssemblyNameFlags.PublicKey");
            if (0!=(anf & AssemblyNameFlags.EnableJITcompileOptimizer))
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileOptimizer");
            if (0!=(anf & AssemblyNameFlags.EnableJITcompileTracking))
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileTracking");
        }
    }
}

/* This code example produces the following output:

AssemblyNameFlags.Retargetable
AssemblyNameFlags.PublicKey
AssemblyNameFlags.EnableJITcompileOptimizer

AssemblyNameFlags.Retargetable
AssemblyNameFlags.EnableJITcompileOptimizer
*/
Imports System.Reflection

' Specify a combination of AssemblyNameFlags for this 
' assembly.
<Assembly:AssemblyFlagsAttribute( _
       AssemblyNameFlags.EnableJITcompileOptimizer _
    Or AssemblyNameFlags.Retargetable)>

Public Class Example
    Public Shared Sub Main()
        ' Get this assembly.
        Dim thisAsm As Assembly = GetType(Example).Assembly

        ' Get the AssemblyName for this assembly.
        Dim thisAsmName As AssemblyName = thisAsm.GetName(False)

        ' Display the flags that were set for this assembly.
        ListFlags(thisAsmName.Flags)

        ' Create an instance of AssemblyFlagsAttribute with the
        ' same combination of flags that was specified for this
        ' assembly. Note that PublicKey is included automatically
        ' for the assembly, but not for this instance of
        ' AssemblyFlagsAttribute.
        Dim afa As New AssemblyFlagsAttribute( _
               AssemblyNameFlags.EnableJITcompileOptimizer _
            Or AssemblyNameFlags.Retargetable)

        ' Get the flags. The property returns an integer, so
        ' the return value must be cast to AssemblyNameFlags.
        Dim anf As AssemblyNameFlags = _
            CType(afa.AssemblyFlags, AssemblyNameFlags)

        ' Display the flags.
        Console.WriteLine()
        ListFlags(anf)
    End Sub

    Private Shared Sub ListFlags(ByVal anf As AssemblyNameFlags)

        If anf = AssemblyNameFlags.None Then
            Console.WriteLine("AssemblyNameFlags.None")
        Else
            If 0 <> (anf And AssemblyNameFlags.Retargetable) Then _
                Console.WriteLine("AssemblyNameFlags.Retargetable")
            If 0 <> (anf And AssemblyNameFlags.PublicKey) Then _
                Console.WriteLine("AssemblyNameFlags.PublicKey")
            If 0 <> (anf And AssemblyNameFlags.EnableJITcompileOptimizer) Then _
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileOptimizer")
            If 0 <> (anf And AssemblyNameFlags.EnableJITcompileTracking) Then _
                Console.WriteLine("AssemblyNameFlags.EnableJITcompileTracking")
        End If

    End SUb
End Class

' This code example produces the following output:
'
'AssemblyNameFlags.Retargetable
'AssemblyNameFlags.PublicKey
'AssemblyNameFlags.EnableJITcompileOptimizer
'
'AssemblyNameFlags.Retargetable
'AssemblyNameFlags.EnableJITcompileOptimizer

こちらもご覧ください

適用対象

AssemblyFlagsAttribute(UInt32)

ソース:
AssemblyFlagsAttribute.cs
ソース:
AssemblyFlagsAttribute.cs
ソース:
AssemblyFlagsAttribute.cs

注意事項

This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. https://go.microsoft.com/fwlink/?linkid=14202

注意事項

This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.

注意事項

This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202

重要

この API は CLS 準拠ではありません。

CLS 準拠の代替
System.Reflection.AssemblyFlagsAttribute.AssemblyFlagsAttribute(AssemblyNameFlags)

符号なし整数値としてキャストされている AssemblyFlagsAttribute フラグの組み合わせを指定して、AssemblyNameFlags クラスの新しいインスタンスを初期化します。

public:
 AssemblyFlagsAttribute(System::UInt32 flags);
[System.CLSCompliant(false)]
[System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. https://go.microsoft.com/fwlink/?linkid=14202")]
public AssemblyFlagsAttribute (uint flags);
[System.CLSCompliant(false)]
[System.Obsolete("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")]
public AssemblyFlagsAttribute (uint flags);
[System.CLSCompliant(false)]
[System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")]
public AssemblyFlagsAttribute (uint flags);
[System.CLSCompliant(false)]
public AssemblyFlagsAttribute (uint flags);
[<System.CLSCompliant(false)>]
[<System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. https://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Reflection.AssemblyFlagsAttribute : uint32 -> System.Reflection.AssemblyFlagsAttribute
[<System.CLSCompliant(false)>]
[<System.Obsolete("This constructor has been deprecated. Use AssemblyFlagsAttribute(AssemblyNameFlags) instead.")>]
new System.Reflection.AssemblyFlagsAttribute : uint32 -> System.Reflection.AssemblyFlagsAttribute
[<System.CLSCompliant(false)>]
[<System.Obsolete("This constructor has been deprecated. Please use AssemblyFlagsAttribute(AssemblyNameFlags) instead. http://go.microsoft.com/fwlink/?linkid=14202")>]
new System.Reflection.AssemblyFlagsAttribute : uint32 -> System.Reflection.AssemblyFlagsAttribute
[<System.CLSCompliant(false)>]
new System.Reflection.AssemblyFlagsAttribute : uint32 -> System.Reflection.AssemblyFlagsAttribute
Public Sub New (flags As UInteger)

パラメーター

flags
UInt32

Just-In-Time (JIT) コンパイラのオプション、有効期限、そのアセンブリが再ターゲット可能かどうか、およびそのアセンブリが完全な公開キーとトークン化された公開キーのどちらを保有しているのかを示す、符号なし整数値としてキャストされた AssemblyNameFlags フラグのビットごとの組み合わせ。

属性

注釈

この型指定されていないコンストラクターは廃止されました。 使用しないでください。

適用対象