Click or drag to resize
FormattingGroup Class
Default implementation of the IFormattingGroup interface, i.e. a set of formatting properties that together represent a formatting override.
Inheritance Hierarchy
SystemObject
  Sdl.FileTypeSupport.Framework.Core.SettingsObservableDictionaryString, IFormattingItem
    Sdl.FileTypeSupport.Framework.Core.Utilities.FormattingFormattingGroup

Namespace: Sdl.FileTypeSupport.Framework.Core.Utilities.Formatting
Assembly: Sdl.FileTypeSupport.Framework.Core.Utilities (in Sdl.FileTypeSupport.Framework.Core.Utilities.dll) Version: 1.0.0.0 (1.0.2551.0)
Syntax
[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.

Constructors
  NameDescription
Public methodFormattingGroup
Default constructor, which creates an empty formatting layer with no formatting types defined.
Protected methodFormattingGroup(FormattingGroup)
Creates a deep copy of the other object
Protected methodFormattingGroup(SerializationInfo, StreamingContext)
protected constructor for deserialization
Top
Properties
  NameDescription
Public propertyCount
The number of elements contained in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Public propertyIsReadOnly
Determines whether the dictionary is read-only.
(Inherited from ObservableDictionaryTKey, TValue.)
Public propertyItem
Retrieves the dictionary element value at the specified key.
(Inherited from ObservableDictionaryTKey, TValue.)
Public propertyKeys
A collection of all element keys contained in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Public propertyPersistenceId
The persistence ID associated with an object may be used by implementations during operations such as serialization and de-serialization of the object model.
Public propertyValues
A collection of all element values contained in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Top
Methods
  NameDescription
Public methodAdd(KeyValuePairTKey, TValue)
Adds a new element to the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodAdd(IFormattingItem)
Insert a formatting type with a specific value in this layer.
Public methodAdd(String, IFormattingItem)
Hiding functionality for the base class Add function, used to ensure that the key is in fact the formatting name.
Public methodClear
Removes all elements from the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Protected methodClearDictionaryItemSettings
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.)
Public methodClone
Implements deep cloning
Public methodContains(KeyValuePairTKey, TValue)
Determines whether the dictionary contains the specified item.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodContains(String)
Checks whether formatting of a specific type is present in this layer.
Public methodContains(IFormattingItem)
Checks whether a specific formatting item or its equivalent is present in this layer.
Public methodContainsKey
Determines whether the dictionary contains an element with the specified key.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodCopyTo
Copies the dictionary elements into the provided array, starting from the specified index in the array.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodStatic memberCreate
Factory method used by the Spring framework.
Public methodEquals (Overrides ObjectEquals(Object).)
Protected methodGetDictionaryItemFromSettingsT
Gets the setting for the dictionary item from the settings group and populates it.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodGetEnumerator
Returns an enumerator that iterates through the collection.
(Inherited from ObservableDictionaryTKey, TValue.)
Protected methodGetFormattingItemFactory
Accessor to the formatting item factory, used by XML deserialization.
Public methodGetHashCode (Overrides ObjectGetHashCode.)
Public methodGetObjectData
Populates serialization information with the elements in the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodGetSchema
Get Schema for IXmlSerializable
Public methodIsCurrentOrPreviousTypeName
Checks the parameter name is of current type or previous type.
Public methodOverrideWith
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.
Public methodPopulateFromSettingsGroup
Restores the dictionary from the settings group and populates itself using the setting ID as its base.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodReadXml
Deserializes the formatting collection
Public methodRemove(KeyValuePairTKey, TValue)
Removes the specified item from the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodRemove(TKey)
Removes the element with the specified key from the dictionary.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodSaveToSettingsGroup
Saves this dictionary to the settings group using the setting ID as a base.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodToString
Overridden for debugging purposes only. Returns a text representation of the formatting.
(Overrides ObjectToString.)
Public methodTryGetValue
Gets the value of the element with the specified key if it exists.
(Inherited from ObservableDictionaryTKey, TValue.)
Public methodUnderrideWith
Adds the formatting represented by the other object into this one. If there are conflicting formatting types, the corresponding values remain unchanged.
Public methodWriteXml
Serializes the formatting collection
Top
Events
Remarks

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.

See Also
Community
Edit

Be the first to Edit the community content of this topic.
Comments