Class FormatManager
Represents a class that helps to manage various operation that are performed by using the formats.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Edit.Implementation.Formatting
Assembly: Syncfusion.Edit.Windows.dll
Syntax
public class FormatManager : EventBaseCollection, IList, ICollection, IEnumerable, IFormatManager, IObjectInitialize, IXmlSerializable, IXMLDataProvider, IDisposable
Constructors
FormatManager()
Declaration
public FormatManager()
Fields
m_hashNames
Stores name-to-format object.
Declaration
protected Hashtable m_hashNames
Field Value
Type |
---|
System.Collections.Hashtable |
m_iMaxCharWidth
This is calculated value and it hold maximum char width according to known for object formats.
Declaration
protected int m_iMaxCharWidth
Field Value
Type |
---|
System.Int32 |
m_iMaxLineHeight
This is calculated value and it hold maximum heigh of line according to known to object formats.
Declaration
protected int m_iMaxLineHeight
Field Value
Type |
---|
System.Int32 |
m_iMinCharWidth
This is calcualted value and it hold minimum char width according to formats known by object.
Declaration
protected int m_iMinCharWidth
Field Value
Type |
---|
System.Int32 |
m_iMinLineHeight
This is calculated value an it hold minimal size of line according to known for object formats
Declaration
protected int m_iMinLineHeight
Field Value
Type |
---|
System.Int32 |
Properties
Item[FormatType]
Gets the format based on its FormatType.
Declaration
public ISnippetFormat this[FormatType type] { get; }
Parameters
Type | Name | Description |
---|---|---|
FormatType | type |
Property Value
Type |
---|
ISnippetFormat |
Item[Int32]
Gets the format based on the given index.
Declaration
public ISnippetFormat this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
ISnippetFormat |
Item[String]
Gets the format based on its name.
Declaration
public ISnippetFormat this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Property Value
Type |
---|
ISnippetFormat |
MaxCharWidth
Gets the maximum character width according to known object formats.
Declaration
public int MaxCharWidth { get; }
Property Value
Type |
---|
System.Int32 |
MaxLineHeight
Gets the maximum height of line according to known object formats.
Declaration
public int MaxLineHeight { get; }
Property Value
Type |
---|
System.Int32 |
MinCharWidth
Gets the minimum character width according to known formats object.
Declaration
public int MinCharWidth { get; }
Property Value
Type |
---|
System.Int32 |
MinLineHeight
Gets the minimum height of line according to known object formats.
Declaration
public int MinLineHeight { get; }
Property Value
Type |
---|
System.Int32 |
ShowWhiteSpaceProperties
Gets or sets the properties of Show white spaces mode.
Declaration
public ShowWhiteSpaceProperties ShowWhiteSpaceProperties { get; set; }
Property Value
Type |
---|
ShowWhiteSpaceProperties |
ShowWhiteSpaces
Gets or sets a value indicating whether the whitespaces are shown as bullets or not.
Declaration
public bool ShowWhiteSpaces { get; set; }
Property Value
Type |
---|
System.Boolean |
SpacesInTab
Gets or sets the count of space characters that was replaced instead of tab character.
Declaration
public int SpacesInTab { get; set; }
Property Value
Type |
---|
System.Int32 |
TabReplaceString
Gets the text( array of spaces ), that was replaced instead of the tab character.
Declaration
public string TabReplaceString { get; }
Property Value
Type |
---|
System.String |
Methods
Add(ISnippetFormat)
Adds format to collection.
Declaration
public void Add(ISnippetFormat format)
Parameters
Type | Name | Description |
---|---|---|
ISnippetFormat | format | Format to add. |
Add(String)
Creates new format and adds it to collection.
Declaration
public ISnippetFormat Add(string formatName)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatName | Name for format. |
Returns
Type | Description |
---|---|
ISnippetFormat | New format. |
Add(String, ISnippetFormat)
Adds new format to collection.
Declaration
public ISnippetFormat Add(string formatName, ISnippetFormat source)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatName | Name of format. |
ISnippetFormat | source | Source format. |
Returns
Type | Description |
---|---|
ISnippetFormat | New format. |
Add(String, String)
Adds new format to collection.
Declaration
public ISnippetFormat Add(string formatName, string sourceName)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatName | Name of format. |
System.String | sourceName | Name of source format. |
Returns
Type | Description |
---|---|
ISnippetFormat | New format. |
AppendToXML(XmlElement)
Append its data to given XML element.
Declaration
public void AppendToXML(XmlElement parent)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | parent | Parent element. |
AppendToXML(XmlTextWriter)
Append its data to given XML.
Declaration
public void AppendToXML(XmlTextWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlTextWriter | writer | Parent element. |
Dispose()
Releases all resources used by this Controls component like Brushes, Fonts.
Declaration
public void Dispose()
GetBackgroundAndTextColorFormat(Color, Color)
Creates new format object with given background and text color or retrieves it from hashtable (if it's already created).
Declaration
public ISnippetFormat GetBackgroundAndTextColorFormat(Color backColor, Color textColor)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | backColor | Color of text background. |
System.Drawing.Color | textColor | Color of text. |
Returns
Type | Description |
---|---|
ISnippetFormat | Created or retrieved format. |
GetBackgroundColorFormat(Color)
Creates new format object with given background color or retrieves it from hashtable (if it's already created).
Declaration
public ISnippetFormat GetBackgroundColorFormat(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | Color of text. |
Returns
Type | Description |
---|---|
ISnippetFormat | Created or retrieved format. |
GetBorderFormat(FrameBorderStyle, Color, BorderWeight)
Creates new format object with given border parameters or retrieves it from hashtable (if it's already created).
Declaration
public ISnippetFormat GetBorderFormat(FrameBorderStyle style, Color color, BorderWeight weight)
Parameters
Type | Name | Description |
---|---|---|
FrameBorderStyle | style | Style of border. |
System.Drawing.Color | color | Color of border. |
BorderWeight | weight | Weight of border line. |
Returns
Type | Description |
---|---|
ISnippetFormat | Created or retrieved format. |
GetBrush(Color)
Gets the cache solid brush of the specified color.
Declaration
public Brush GetBrush(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | Color of the needed brush. |
Returns
Type | Description |
---|---|
System.Drawing.Brush | Solid brush. |
GetBrush(HatchStyle, Color, Color)
Gets the cache brush with a needed hatch style.
Declaration
public Brush GetBrush(HatchStyle style, Color foreColor, Color backColor)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Drawing2D.HatchStyle | style | HatchStyle of the needed brush. |
System.Drawing.Color | foreColor | Color of the needed brush. |
System.Drawing.Color | backColor | Background color. |
Returns
Type | Description |
---|---|
System.Drawing.Brush | Brush. You do not have to dispose it later, it will be done automatically. |
GetPen(Color)
Gets the cache pen with a needed color.
Declaration
public Pen GetPen(Color penColor)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | penColor | Color of the needed pen. |
Returns
Type | Description |
---|---|
System.Drawing.Pen | Pen. You do not have to dispose this pen later, it will be done automatically. |
GetSchema()
Gets XSD Schema for serialization.
Declaration
public virtual XmlSchema GetSchema()
Returns
Type | Description |
---|---|
System.Xml.Schema.XmlSchema | XmlSchema. |
GetStrikeOutFormat(Color)
Gets the format which is used for striking out.
Declaration
public Format GetStrikeOutFormat(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | Color to use. |
Returns
Type | Description |
---|---|
Format | Format. |
GetTabString()
Gets tab string with legth set to SpacesInTab.
Declaration
public string GetTabString()
Returns
Type | Description |
---|---|
System.String | Tab string with legth set to SpacesInTab. |
GetTextColorFormat(Color)
Creates new format object with given text color or retrieves it from hashtable (if it's already created).
Declaration
public ISnippetFormat GetTextColorFormat(Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Color | color | Color of text. |
Returns
Type | Description |
---|---|
ISnippetFormat | Created or retrieved format. |
Initialize()
Initializes object. Rebuilds hashes.
Declaration
public virtual void Initialize()
OnFormatChanged(Format)
Raises FormatChanged event.
Declaration
protected virtual void OnFormatChanged(Format format)
Parameters
Type | Name | Description |
---|---|---|
Format | format | Format that has been changed. |
OnInsertComplete(Int32, Object)
Adds Changed event handling.
Declaration
protected override void OnInsertComplete(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Zero-base index of in collection. |
System.Object | value | Format that has been inserted. |
Overrides
OnRemoveComplete(Int32, Object)
Removes Changed event handling.
Declaration
protected override void OnRemoveComplete(int index, object value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Zero-base index of in collection. |
System.Object | value | Format that has been removed. |
Overrides
ReadXml(XmlReader)
Helps to read the complex object.
Declaration
public virtual void ReadXml(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | XmlReader. |
RebuildHashes()
Rebuilds hash of the name:format pairs.
Declaration
protected virtual void RebuildHashes()
Recalculation()
Recalcualtes Min/Max line heights.
Declaration
protected virtual void Recalculation()
Remove(ISnippetFormat)
Removes the specified format from the collection.
Declaration
public void Remove(ISnippetFormat format)
Parameters
Type | Name | Description |
---|---|---|
ISnippetFormat | format | Format to remove. |
Remove(String)
Removes the specified format from the collection.
Declaration
public void Remove(string formatName)
Parameters
Type | Name | Description |
---|---|---|
System.String | formatName | Name of format to remove. |
WriteXml(XmlWriter)
Helps to write the complex object.
Declaration
public virtual void WriteXml(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | XmlWriter. |
Events
FormatChanged
Occurs after format has changed.
Declaration
public event EventHandler FormatChanged
Event Type
Type |
---|
System.EventHandler |