BamlLocalizationDictionary Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Contains all the localizable resources in a BAML record.

Namespace:   System.Windows.Markup.Localizer
Assembly:  PresentationFramework (in PresentationFramework.dll)

System.Object
  System.Windows.Markup.Localizer.BamlLocalizationDictionary

public sealed class BamlLocalizationDictionary : IDictionary, 
	ICollection, IEnumerable

NameDescription
System_CAPS_pubmethodBamlLocalizationDictionary()

Initializes a new instance of the BamlLocalizationDictionary class.

NameDescription
System_CAPS_pubpropertyCount

Gets the number of localizable resources in the BamlLocalizationDictionary.

System_CAPS_pubpropertyIsFixedSize

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

System_CAPS_pubpropertyIsReadOnly

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

System_CAPS_pubpropertyItem[BamlLocalizableResourceKey]

Gets or sets a localizable resource specified by its key.

System_CAPS_pubpropertyKeys

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

System_CAPS_pubpropertyRootElementKey

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

System_CAPS_pubpropertyValues

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

NameDescription
System_CAPS_pubmethodAdd(BamlLocalizableResourceKey, BamlLocalizableResource)

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

System_CAPS_pubmethodClear()

Deletes all resources from the BamlLocalizationDictionary object.

System_CAPS_pubmethodContains(BamlLocalizableResourceKey)

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

System_CAPS_pubmethodCopyTo(DictionaryEntry[], Int32)

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

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator that iterates through the BamlLocalizationDictionary.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodRemove(BamlLocalizableResourceKey)

Removes a specified localizable resource from the BamlLocalizationDictionary.

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodICollection.CopyTo(Array, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see ICollection.CopyTo.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDictionary.Add(Object, Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IDictionary.Add.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDictionary.Contains(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IDictionary.Contains.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDictionary.GetEnumerator()

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IDictionary.GetEnumerator.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIDictionary.Remove(Object)

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IDictionary.Remove.

System_CAPS_pubinterfaceSystem_CAPS_privmethodIEnumerable.GetEnumerator()

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IEnumerable.GetEnumerator.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.Count

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see ICollection.Count.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.IsSynchronized

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see ICollection.IsSynchronized.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyICollection.SyncRoot

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see ICollection.SyncRoot.

System_CAPS_pubinterfaceSystem_CAPS_privpropertyIDictionary.Item[Object]

This API supports the product infrastructure and is not intended to be used directly from your code. For a description of this member, see IDictionary.Item.

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

The dictionary contains a mapping from resource keys (specified as BamlLocalizableResourceKey objects) to resource values (specified as BamlLocalizableResource objects).

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

.NET Framework
Available since 3.0

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

Return to top
Show: