共用方式為


BamlLocalizableResource 類別

定義

表示 BAML 資料流中可當地語系化的資源。

public ref class BamlLocalizableResource
public class BamlLocalizableResource
type BamlLocalizableResource = class
Public Class BamlLocalizableResource
繼承
BamlLocalizableResource

範例

下列範例示範如何使用 BamlLocalizableResource


// Obtain the BAML stream.
Stream source = entry.Value as Stream;

// Create a BamlLocalizer on the stream.
BamlLocalizer localizer = new BamlLocalizer(source);
BamlLocalizationDictionary resources = localizer.ExtractResources();

// Write out all the localizable resources in the BAML.
foreach (DictionaryEntry resourceEntry in resources)
{
    BamlLocalizableResourceKey key = resourceEntry.Key as BamlLocalizableResourceKey;
    BamlLocalizableResource value = resourceEntry.Value as BamlLocalizableResource;
    Console.WriteLine(
        "    {0}.{1}.{2} = {3}",
        key.Uid,
        key.ClassName,
        key.PropertyName,
        value.Content
        );                                
}

' Obtain the BAML stream.
Dim source As Stream = TryCast(entry.Value, Stream)

' Create a BamlLocalizer on the stream.
Dim localizer As New BamlLocalizer(source)
Dim resources As BamlLocalizationDictionary = localizer.ExtractResources()

' Write out all the localizable resources in the BAML.
For Each resourceEntry As DictionaryEntry In resources
    Dim key As BamlLocalizableResourceKey = TryCast(resourceEntry.Key, BamlLocalizableResourceKey)
    Dim value As BamlLocalizableResource = TryCast(resourceEntry.Value, BamlLocalizableResource)
    Console.WriteLine("    {0}.{1}.{2} = {3}", key.Uid, key.ClassName, key.PropertyName, value.Content)
Next resourceEntry

備註

類別 BamlLocalizableResource 是 中找到 BamlLocalizationDictionary 之索引鍵/值組的值元件。

建構函式

BamlLocalizableResource()

初始化 BamlLocalizableResource 類別的新執行個體。

BamlLocalizableResource(String, String, LocalizationCategory, Boolean, Boolean)

使用指定的可當地語系化值、當地語系化註解、資源分類、當地語系化鎖定狀態和資源的可視性,初始化 BamlLocalizableResource 類別的新執行個體。

屬性

Category

取得或設定資源的當地語系化分類。

Comments

取得或設定與資源相關聯的當地語系化註解。

Content

取得或設定可當地語系化的內容。

Modifiable

取得或設定值,這個值表示可當地語系化的資源是否可修改。

Readable

取得或設定資源是否可見,可以進行轉譯。

方法

Equals(Object)

判斷指定的 BamlLocalizableResource 物件是否等於這個物件。

GetHashCode()

傳回整數雜湊程式碼,這個雜湊程式碼表示這個執行個體。

GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

適用於

另請參閱