CompilerGlobalScopeAttribute Kelas

Definisi

Menunjukkan bahwa kelas harus diperlakukan seolah-olah memiliki cakupan global.

public ref class CompilerGlobalScopeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
public class CompilerGlobalScopeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
public class CompilerGlobalScopeAttribute : Attribute
[System.AttributeUsage(System.AttributeTargets.Class)]
[System.Serializable]
[System.Runtime.InteropServices.ComVisible(true)]
public class CompilerGlobalScopeAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
type CompilerGlobalScopeAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
type CompilerGlobalScopeAttribute = class
    inherit Attribute
[<System.AttributeUsage(System.AttributeTargets.Class)>]
[<System.Serializable>]
[<System.Runtime.InteropServices.ComVisible(true)>]
type CompilerGlobalScopeAttribute = class
    inherit Attribute
Public Class CompilerGlobalScopeAttribute
Inherits Attribute
Warisan
CompilerGlobalScopeAttribute
Atribut

Contoh

Contoh kode berikut menunjukkan cara menerapkan CompilerGlobalScopeAttribute.

using System;
using System.Runtime.CompilerServices;

[CompilerGlobalScopeAttribute()]
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("The attribute was applied.");
    }
}
Imports System.Runtime.CompilerServices

<CompilerGlobalScopeAttribute()> _
Module Program


    Sub Main(ByVal args() As String)
        Console.WriteLine("The attribute was applied.")
    End Sub


End Module

Keterangan

Anda dapat menerapkan atribut ini ke kelas.

Kelas ini hanya digunakan untuk komunikasi dengan alat debugger.

Kelas di System.Runtime.CompilerServices hanya digunakan untuk penulis kompilator.

Konstruktor

CompilerGlobalScopeAttribute()

Menginisialisasi instans baru kelas CompilerGlobalScopeAttribute.

Properti

TypeId

Ketika diimplementasikan di kelas turunan, mendapatkan pengidentifikasi unik untuk ini Attribute.

(Diperoleh dari Attribute)

Metode

Equals(Object)

Mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
GetHashCode()

Mengembalikan kode hash untuk instans ini.

(Diperoleh dari Attribute)
GetType()

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
IsDefaultAttribute()

Ketika ditimpa di kelas turunan, menunjukkan apakah nilai instans ini adalah nilai default untuk kelas turunan.

(Diperoleh dari Attribute)
Match(Object)

Saat ditimpa di kelas turunan, mengembalikan nilai yang menunjukkan apakah instans ini sama dengan objek tertentu.

(Diperoleh dari Attribute)
MemberwiseClone()

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Implementasi Antarmuka Eksplisit

_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

Memetakan sekumpulan nama ke sekumpulan pengidentifikasi pengiriman yang sesuai.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

Mengambil informasi jenis untuk objek, yang dapat digunakan untuk mendapatkan informasi jenis untuk antarmuka.

(Diperoleh dari Attribute)
_Attribute.GetTypeInfoCount(UInt32)

Mengambil jumlah antarmuka informasi jenis yang disediakan objek (baik 0 atau 1).

(Diperoleh dari Attribute)
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Menyediakan akses ke properti dan metode yang diekspos oleh objek.

(Diperoleh dari Attribute)

Berlaku untuk