Class AbstractFormattingItem
Abstract base class for formatting items; provides a default implementation of the IFormattingItem interface, implements Equals(Object) and GetHashCode() using the FormattingName and StringValue.
Inheritance
Inherited Members
Namespace: Sdl.FileTypeSupport.Framework.Formatting
Assembly: Sdl.FileTypeSupport.Framework.Core.dll
Syntax
public abstract class AbstractFormattingItem : IFormattingItem, ICloneable
Constructors
AbstractFormattingItem()
Declaration
protected AbstractFormattingItem()
Properties
FormattingName
The name of this type of formatting. The default implementation returns the type name of the actual class, but this can be overridden in derived classes.
The name may be used as an attribute name when storing this formatting in XML format, in which case the value of the attribute represents the StringValue property.
Declaration
public virtual string FormattingName { get; }
Property Value
Type | Description |
---|---|
System.String |
LocalizedFormattingName
A localized representation of the formatting name; the default implementation returns FormattingName.
Declaration
public virtual string LocalizedFormattingName { get; }
Property Value
Type | Description |
---|---|
System.String |
LocalizedStringValue
A localized representation of the formatting value. The default implementation returns StringValue.
Declaration
public virtual string LocalizedStringValue { get; }
Property Value
Type | Description |
---|---|
System.String |
StringValue
The value this formatting represents as a string.
Derived formatting classes should allow their entire value to be retrieved and set through this property.
The name and string value may be used for storing formatting as an XML attribute with a value.
Declaration
public abstract string StringValue { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
AcceptVisitor(IFormattingVisitor)
Implementation of the visitor pattern.
Derived formatting classes should implement this by calling into the appropriate method on the visitor.
Declaration
public abstract void AcceptVisitor(IFormattingVisitor visitor)
Parameters
Type | Name | Description |
---|---|---|
IFormattingVisitor | visitor |
Clone()
Must be overridden in all directly and indirectly derived classes to return objects of the correct type.
Declaration
public abstract object Clone()
Returns
Type | Description |
---|---|
System.Object | A clone of this object |
Equals(Object)
Compares the name and value properties of the objects.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The System.Object to compare with the current System.Object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the specified System.Object is equal to the current System.Object, otherwise false. |
Overrides
GetDefaultName(MemberInfo)
The default name for an IFormattingItem type
Declaration
protected static string GetDefaultName(MemberInfo type)
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | type |
Returns
Type | Description |
---|---|
System.String |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A hash code for the current System.Object. |
Overrides
ToString()
For debugging; returns "FormattingName = StringValue".
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |