| FormattingGroup Class |
Namespace: Sdl.FileTypeSupport.Framework.Core.Utilities.Formatting
[SerializableAttribute] public class FormattingGroup : ObservableDictionary<string, IFormattingItem>, IFormattingGroup, IDictionary<string, IFormattingItem>, ICollection<KeyValuePair<string, IFormattingItem>>, IEnumerable<KeyValuePair<string, IFormattingItem>>, IEnumerable, ICloneable, IXmlSerializable
The FormattingGroup type exposes the following members.
| Name | Description | |
|---|---|---|
| FormattingGroup |
Default constructor, which creates an empty formatting layer with no formatting types defined.
| |
| FormattingGroup(FormattingGroup) |
Creates a deep copy of the other object
| |
| FormattingGroup(SerializationInfo, StreamingContext) |
protected constructor for deserialization
|
| Name | Description | |
|---|---|---|
| Count |
The number of elements contained in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| IsReadOnly |
Determines whether the dictionary is read-only.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Item |
Retrieves the dictionary element value at the specified key.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Keys |
A collection of all element keys contained in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| PersistenceId |
The persistence ID associated with an object may be used
by implementations during operations such as serialization
and de-serialization of the object model.
| |
| Values |
A collection of all element values contained in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) |
| Name | Description | |
|---|---|---|
| Add(KeyValuePairTKey, TValue) |
Adds a new element to the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Add(IFormattingItem) |
Insert a formatting type with a specific value in this layer.
| |
| Add(String, IFormattingItem) |
Hiding functionality for the base class Add function,
used to ensure that the key is in fact the formatting name.
| |
| Clear |
Removes all elements from the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| ClearDictionaryItemSettings |
Removes all saved items belonging to this dictionary from the stored settings group. This is
called from SaveToSettingsGroup(ISettingsGroup, String) to make sure that the settings being updated
are all saved cleanly.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Clone |
Implements deep cloning
| |
| Contains(KeyValuePairTKey, TValue) |
Determines whether the dictionary contains the specified item.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Contains(String) |
Checks whether formatting of a specific type is present in this layer.
| |
| Contains(IFormattingItem) |
Checks whether a specific formatting item or its equivalent is present in this layer.
| |
| ContainsKey |
Determines whether the dictionary contains an element with the specified key.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| CopyTo |
Copies the dictionary elements into the provided array, starting
from the specified index in the array.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Create |
Factory method used by the Spring framework.
| |
| Equals | (Overrides ObjectEquals(Object).) | |
| GetDictionaryItemFromSettingsT |
Gets the setting for the dictionary item from the settings group and populates it.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| GetEnumerator |
Returns an enumerator that iterates through the collection.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| GetFormattingItemFactory |
Accessor to the formatting item factory, used by XML deserialization.
| |
| GetHashCode | (Overrides ObjectGetHashCode.) | |
| GetObjectData |
Populates serialization information with the elements in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| GetSchema |
Get Schema for IXmlSerializable
| |
| IsCurrentOrPreviousTypeName |
Checks the parameter name is of current type or previous type.
| |
| OverrideWith |
Adds all formatting represented by the other object into this one. If there
are conflicting formatting types, the values from the other object overrides the
values in this object, effectively overlaying that type of formatting.
| |
| PopulateFromSettingsGroup |
Restores the dictionary from the settings group and populates itself using the setting ID as its base.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| ReadXml |
Deserializes the formatting collection
| |
| Remove(KeyValuePairTKey, TValue) |
Removes the specified item from the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| Remove(TKey) |
Removes the element with the specified key from the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| SaveToSettingsGroup |
Saves this dictionary to the settings group using the setting ID as a base.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| ToString |
Overridden for debugging purposes only. Returns a text representation of the formatting.
(Overrides ObjectToString.) | |
| TryGetValue |
Gets the value of the element with the specified key if it
exists.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| UnderrideWith |
Adds the formatting represented by the other object into this one. If there
are conflicting formatting types, the corresponding values remain unchanged.
| |
| WriteXml |
Serializes the formatting collection
|
| Name | Description | |
|---|---|---|
| CollectionChanged |
Event that is fired whenever the contents of the collection are changed.
(Inherited from ObservableDictionaryTKey, TValue.) | |
| PropertyChanged |
Event that is fired whenever the value of a property of the collection is changed.
(Inherited from ObservableDictionaryTKey, TValue.) |
IFormattingGroup instances should normally be created using the IFormattingItemFactory, which is accessible from the IPropertiesFactory. However, if the factory is for some reason not available, this class provides a useful default implementation that can be instantiated directly.
This is a dictionary of key/value pairs, which contains formatting names as keys and formatting items as values. Naturally, it is only possible to define a single value for each type of formatting.
Very often, formatting is used together with a FormattingStack, where different formatting is overlaid with each other. When formatting types conflict, values for the more significant layers override values for the same type in less significant layers.
You can use OverrideWith(IFormattingGroup) and UnderrideWith(IFormattingGroup) to merge other formatting layers with this one.