| IFormattingGroup Interface |
A collection of non-conflicting formatting items that together specify a fully defined formatting or a formatting override.
Namespace: Sdl.FileTypeSupport.Framework.Formatting
The IFormattingGroup type exposes the following members.
| Name | Description | |
|---|---|---|
| Add(T) | Adds an item to the ICollectionT. (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| Add(IFormattingItem) |
Adds a formatting item to the collection. The FormattingName is used as a key.
If a formatting of this type already exists, it will be replaced.
| |
| Add(TKey, TValue) | Adds an element with the provided key and value to the IDictionaryTKey, TValue. (Inherited from IDictionaryString, IFormattingItem.) | |
| Clear | Removes all items from the ICollectionT. (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| Clone | Creates a new object that is a copy of the current instance. (Inherited from ICloneable.) | |
| Contains(T) | Determines whether the ICollectionT contains a specific value. (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| Contains(String) |
Tests whether the collection contains a formatting item of a certain type.
| |
| Contains(IFormattingItem) |
Tests whether an equivalent formatting is part of the collection.
| |
| ContainsKey | Determines whether the IDictionaryTKey, TValue contains an element with the specified key. (Inherited from IDictionaryString, IFormattingItem.) | |
| CopyTo | (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| GetEnumerator | Returns an enumerator that iterates through the collection. (Inherited from IEnumerableKeyValuePairString, IFormattingItem.) | |
| GetEnumerator | Returns an enumerator that iterates through a collection. (Inherited from IEnumerable.) | |
| GetSchema | This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the XmlSchemaProviderAttribute to the class. (Inherited from IXmlSerializable.) | |
| OverrideWith |
Adds each formatting item from the other object to this one, thereby overwriting
any formatting of the same type in this object. Any formatting items
in this object that do not have corresponding formatting items in the
other object remain unchanged.
This can be used to apply a formatting override. | |
| ReadXml | Generates an object from its XML representation. (Inherited from IXmlSerializable.) | |
| Remove(TKey) | Removes the element with the specified key from the IDictionaryTKey, TValue. (Inherited from IDictionaryString, IFormattingItem.) | |
| Remove(T) | Removes the first occurrence of a specific object from the ICollectionT. (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| TryGetValue | Gets the value associated with the specified key. (Inherited from IDictionaryString, IFormattingItem.) | |
| UnderrideWith |
Adds each formatting item from the other formatting that does not already
exist in this collection.
This can be used to "overlay" formatting overrides when starting from the most significant formatting. The difference to OverrideWith(IFormattingGroup) is the fact that existing formatting in this object is always preserved. | |
| WriteXml | Converts an object into its XML representation. (Inherited from IXmlSerializable.) |
| Name | Description | |
|---|---|---|
| Count | Gets the number of elements contained in the ICollectionT. (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| IsReadOnly | Gets a value indicating whether the ICollectionT is read-only. (Inherited from ICollectionKeyValuePairString, IFormattingItem.) | |
| ItemTKey | Gets or sets the element with the specified key. (Inherited from IDictionaryString, IFormattingItem.) | |
| ItemString |
Retrieves a formatting item of a specified type.
| |
| Keys | Gets an ICollectionT containing the keys of the IDictionaryTKey, TValue. (Inherited from IDictionaryString, IFormattingItem.) | |
| Values | Gets an ICollectionT containing the values in the IDictionaryTKey, TValue. (Inherited from IDictionaryString, IFormattingItem.) |
Instances of this class should normally be created by calling CreateFormatting, or by cloning an existing instance. (IFormattingItemFactory is typically accessed from the FormattingItemFactory property.)
The collection is a dictionary indexed using the FormattingName as keys for the contained formatting items.
Can be combined with other formatting by calling OverrideWith(IFormattingGroup) or UnderrideWith(IFormattingGroup).
void SetNoBold(IFormattingGroup fmt) { // check if there is bold formatting already if (fmt.ContainsKey(Bold.Name)) { // explicitly override by setting our formatting instead Bold notBold = new Bold(false); fmt.Add(notBold); } }