BamlLocalizationDictionary BamlLocalizationDictionary BamlLocalizationDictionary BamlLocalizationDictionary Class

Definition

Contains all the localizable resources in a BAML record.

public ref class BamlLocalizationDictionary sealed : System::Collections::IDictionary
public sealed class BamlLocalizationDictionary : System.Collections.IDictionary
type BamlLocalizationDictionary = class
    interface IDictionary
    interface ICollection
    interface IEnumerable
Public NotInheritable Class BamlLocalizationDictionary
Implements IDictionary
Inheritance
BamlLocalizationDictionaryBamlLocalizationDictionaryBamlLocalizationDictionaryBamlLocalizationDictionary
Implements

Examples

The following example demonstrates how to use a BamlLocalizationDictionary.


// 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 dictionary contains a mapping from resource keys (specified as BamlLocalizableResourceKey objects) to resource values (specified as BamlLocalizableResource objects).

Constructors

BamlLocalizationDictionary() BamlLocalizationDictionary() BamlLocalizationDictionary() BamlLocalizationDictionary()

Initializes a new instance of the BamlLocalizationDictionary class.

Properties

Count Count Count Count

Gets the number of localizable resources in the BamlLocalizationDictionary.

IsFixedSize IsFixedSize IsFixedSize IsFixedSize

Gets a value that indicates whether the BamlLocalizationDictionary object has a fixed size.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

Gets a value that indicates whether the BamlLocalizationDictionary object is read-only.

Item[BamlLocalizableResourceKey] Item[BamlLocalizableResourceKey] Item[BamlLocalizableResourceKey] Item[BamlLocalizableResourceKey]

Gets or sets a localizable resource specified by its key.

Keys Keys Keys Keys

Gets a collection that contains all the keys in the BamlLocalizationDictionary object.

RootElementKey RootElementKey RootElementKey RootElementKey

Gets the key of the root element, if it is localizable.

Values Values Values Values

Gets a collection that contains all the values in the BamlLocalizationDictionary.

Methods

Add(BamlLocalizableResourceKey, BamlLocalizableResource) Add(BamlLocalizableResourceKey, BamlLocalizableResource) Add(BamlLocalizableResourceKey, BamlLocalizableResource) Add(BamlLocalizableResourceKey, BamlLocalizableResource)

Adds an item with the provided key and value to the BamlLocalizationDictionary.

Clear() Clear() Clear() Clear()

Deletes all resources from the BamlLocalizationDictionary object.

Contains(BamlLocalizableResourceKey) Contains(BamlLocalizableResourceKey) Contains(BamlLocalizableResourceKey) Contains(BamlLocalizableResourceKey)

Determines whether a BamlLocalizationDictionary object contains a resource with a specified key.

CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32) CopyTo(DictionaryEntry[], Int32)

Copies the contents of a BamlLocalizationDictionary object to a one-dimensional array of DictionaryEntry objects, starting at a specified index.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

Returns an enumerator that iterates through the BamlLocalizationDictionary.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(BamlLocalizableResourceKey) Remove(BamlLocalizableResourceKey) Remove(BamlLocalizableResourceKey) Remove(BamlLocalizableResourceKey)

Removes a specified localizable resource from the BamlLocalizationDictionary.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Explicit Interface Implementations

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

For a description of this member, see CopyTo(Array, Int32).

ICollection.Count ICollection.Count ICollection.Count ICollection.Count

For a description of this member, see Count.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

For a description of this member, see IsSynchronized.

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

For a description of this member, see SyncRoot.

IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object) IDictionary.Add(Object, Object)

For a description of this member, see Add(Object, Object).

IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object) IDictionary.Contains(Object)

For a description of this member, see Contains(Object).

IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator() IDictionary.GetEnumerator()

For a description of this member, see GetEnumerator().

IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object] IDictionary.Item[Object]

For a description of this member, see Item[Object].

IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object) IDictionary.Remove(Object)

For a description of this member, see Remove(Object).

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

For a description of this member, see GetEnumerator().

Extension Methods

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

Converts an IEnumerable to an IQueryable.

Applies to

See also