DefaultDependencyAttribute(LoadHint) 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
使用指定的 DefaultDependencyAttribute 繫結,初始化 LoadHint 類別的新執行個體。
public:
DefaultDependencyAttribute(System::Runtime::CompilerServices::LoadHint loadHintArgument);
public DefaultDependencyAttribute (System.Runtime.CompilerServices.LoadHint loadHintArgument);
new System.Runtime.CompilerServices.DefaultDependencyAttribute : System.Runtime.CompilerServices.LoadHint -> System.Runtime.CompilerServices.DefaultDependencyAttribute
Public Sub New (loadHintArgument As LoadHint)
參數
範例
下列程式代碼範例示範如何將 屬性套用 DefaultDependencyAttribute 至元件,以指定可能載入相依性。
using System;
using System.Runtime.CompilerServices;
[assembly: DefaultDependencyAttribute(LoadHint.Always)]
class Program
{
static void Main(string[] args)
{
Console.WriteLine("The DefaultDependencyAttribute attribute was applied.");
}
}
Imports System.Runtime.CompilerServices
<Assembly: DefaultDependencyAttribute(LoadHint.Always)>
Module Program
Sub Main(ByVal args() As String)
Console.WriteLine("The DefaultDependencyAttribute attribute was applied.")
End Sub
End Module