BamlLocalizableResource Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a localizable resource in a BAML stream.
public ref class BamlLocalizableResource
public class BamlLocalizableResource
type BamlLocalizableResource = class
Public Class BamlLocalizableResource
- Inheritance
-
BamlLocalizableResource
Examples
The following example demonstrates how to use a 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
Remarks
The BamlLocalizableResource class is the value component of the key-value pairs found in a BamlLocalizationDictionary.
Constructors
BamlLocalizableResource() |
Initializes a new instance of the BamlLocalizableResource class. |
BamlLocalizableResource(String, String, LocalizationCategory, Boolean, Boolean) |
Initializes a new instance of the BamlLocalizableResource class, with the specified localizable value, localization comments, resource category, localization lock status, and visibility of the resource. |
Properties
Category |
Gets or sets the localization category of a resource. |
Comments |
Gets or sets the localization comments associated with a resource. |
Content |
Gets or sets the localizable content. |
Modifiable |
Gets or sets a value that indicates whether the localizable resource is modifiable. |
Readable |
Gets or sets whether the resource is visible for translation. |
Methods
Equals(Object) |
Determines whether a specified BamlLocalizableResource object is equal to this object. |
GetHashCode() |
Returns an integer hash code representing this instance. |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기