Export (0) Print
Expand All

BamlLocalizationDictionary Class

Contains all the localizable resources in a BAML record.


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

public sealed class BamlLocalizationDictionary : IDictionary, 
	ICollection, IEnumerable

The BamlLocalizationDictionary type exposes the following members.

Public methodBamlLocalizationDictionaryInitializes a new instance of the BamlLocalizationDictionary class.

Public propertyCountGets the number of localizable resources in the BamlLocalizationDictionary.
Public propertyIsFixedSizeGets a value that indicates whether the BamlLocalizationDictionary object has a fixed size.
Public propertyIsReadOnlyGets a value that indicates whether the BamlLocalizationDictionary object is read-only.
Public propertyItemGets or sets a localizable resource specified by its key.
Public propertyKeysGets a collection that contains all the keys in the BamlLocalizationDictionary object.
Public propertyRootElementKeyGets the key of the root element, if it is localizable.
Public propertyValuesGets a collection that contains all the values in the BamlLocalizationDictionary.

Public methodAddAdds an item with the provided key and value to the BamlLocalizationDictionary.
Public methodClearDeletes all resources from the BamlLocalizationDictionary object.
Public methodContainsDetermines whether a BamlLocalizationDictionary object contains a resource with a specified key.
Public methodCopyToCopies the contents of a BamlLocalizationDictionary object to a one-dimensional array of DictionaryEntry objects, starting at a specified index.
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that iterates through the BamlLocalizationDictionary.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodRemoveRemoves a specified localizable resource from the BamlLocalizationDictionary.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)

Public Extension MethodAsParallelEnables parallelization of a query. (Defined by ParallelEnumerable.)
Public Extension MethodAsQueryableConverts an IEnumerable to an IQueryable. (Defined by Queryable.)
Public Extension MethodCast<TResult>Casts the elements of an IEnumerable to the specified type. (Defined by Enumerable.)
Public Extension MethodOfType<TResult>Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.)

Explicit interface implemetationPrivate methodICollection.CopyToInfrastructure. For a description of this member, see ICollection.CopyTo.
Explicit interface implemetationPrivate propertyICollection.CountInfrastructure. For a description of this member, see ICollection.Count.
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedInfrastructure. For a description of this member, see ICollection.IsSynchronized.
Explicit interface implemetationPrivate propertyICollection.SyncRootInfrastructure. For a description of this member, see ICollection.SyncRoot.
Explicit interface implemetationPrivate methodIDictionary.AddInfrastructure. For a description of this member, see IDictionary.Add.
Explicit interface implemetationPrivate methodIDictionary.ContainsInfrastructure. For a description of this member, see IDictionary.Contains.
Explicit interface implemetationPrivate methodIDictionary.GetEnumeratorInfrastructure. For a description of this member, see IDictionary.GetEnumerator.
Explicit interface implemetationPrivate propertyIDictionary.ItemInfrastructure. For a description of this member, see IDictionary.Item.
Explicit interface implemetationPrivate methodIDictionary.RemoveInfrastructure. For a description of this member, see IDictionary.Remove.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorInfrastructure. For a description of this member, see IEnumerable.GetEnumerator.

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;
        "    {0}.{1}.{2} = {3}",

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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