共用方式為


DefaultDependencyAttribute(LoadHint) 建構函式

定義

使用指定的 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)

參數

loadHintArgument
LoadHint

其中一個 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

適用於