Export (0) Print
Expand All

BamlLocalizableResource Class

Represents a localizable resource in a BAML stream.

System.Object
  System.Windows.Markup.Localizer.BamlLocalizableResource

Namespace:  System.Windows.Markup.Localizer
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: Not mapped to an xmlns.

public class BamlLocalizableResource

The BamlLocalizableResource type exposes the following members.

  NameDescription
Public methodBamlLocalizableResource()Initializes a new instance of the BamlLocalizableResource class.
Public methodBamlLocalizableResource(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.
Top

  NameDescription
Public propertyCategoryGets or sets the localization category of a resource.
Public propertyCommentsGets or sets the localization comments associated with a resource.
Public propertyContentGets or sets the localizable content.
Public propertyModifiableGets or sets a value that indicates whether the localizable resource is modifiable.
Public propertyReadableGets or sets whether the resource is visible for translation.
Top

  NameDescription
Public methodEqualsDetermines whether a specified BamlLocalizableResource object is equal to this object. (Overrides Object.Equals(Object).)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeReturns an integer hash code representing this instance. (Overrides Object.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The BamlLocalizableResource class is the value component of the key-value pairs found in a BamlLocalizationDictionary.

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
        );                                
}

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft