共用方式為


匯入的模組轉換

更新:2007 年 11 月

型別程式庫可以擁有一個或多個含有常數和方法定義的模組。在模組內定義的常數會匯入,做為與原來模組具有同樣名稱之類別的公用常數靜態成員。在模組之外定義的常數則不會匯入。

型別程式庫表示

[
    uuid(12345678-1234-1234-1234-123456789ABC),  
]
library TestConstants
{
    [
        uuid(12345678-1234-1234-1234-123456789ABC),  
        dllname("test.dll")
    ]
    module Constants
    {
        const short FRAME_COLOR = 0x10;
        const short WINDOW_COLOR = 0x20;
        const short BUTTON_COLOR = 0x40;
        …
    };
};

轉換後的型別顯示如下:

Public Class Constants
    Public Const FRAME_COLOR As Short = &H10
    Public Const WINDOW_COLOR As Short = &H20
    Public Const BUTTON_COLOR As Short = &H40
End Class
public class Constants
{
    public const short FRAME_COLOR = 0x10;
    public const short WINDOW_COLOR = 0x20;
    public const short BUTTON_COLOR = 0x40;
}

請參閱

概念

匯入的程式庫轉換

匯入的型別轉換

匯入的成員轉換

匯入的參數轉換

其他資源

型別程式庫至組件轉換的摘要