Class DynamicFormatLayer
Represents a class that helps to manages dynamic formats. Dynamic formatting can be applied to any part of text.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Edit.Implementation.Formatting
Assembly: Syncfusion.Edit.Windows.dll
Syntax
public class DynamicFormatLayer : IDynamicFormatsLayer, ICollection, IEnumerable, IDisposable
Constructors
DynamicFormatLayer()
Initializes a new instance of the DynamicFormatLayer class.
Declaration
public DynamicFormatLayer()
DynamicFormatLayer(Boolean)
Initializes a new instance of the DynamicFormatLayer class.
Declaration
public DynamicFormatLayer(bool bHidden)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | bHidden | Bool that determines whether layer should be hidden. |
Properties
Count
Gets the number of items that contained in formatting collection.
Declaration
public int Count { get; }
Property Value
| Type |
|---|
| System.Int32 |
Hidden
Gets a value indicating whether this layer is hidden or not.
Declaration
public bool Hidden { get; }
Property Value
| Type |
|---|
| System.Boolean |
IsSynchronized
Gets or sets a value indicating whether the list is thread safe or not.
Declaration
public bool IsSynchronized { get; }
Property Value
| Type |
|---|
| System.Boolean |
Item[CoordinatePoint]
Gets the dynamic formatting by ParsePoint.
Declaration
public IDynamicFormat this[CoordinatePoint point] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| CoordinatePoint | point |
Property Value
| Type |
|---|
| IDynamicFormat |
Item[CoordinatePoint, CoordinatePoint]
Gets the list of dynamic formatting, that intercepts with given range.
Declaration
public IList this[CoordinatePoint start, CoordinatePoint end] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| CoordinatePoint | start | |
| CoordinatePoint | end |
Property Value
| Type |
|---|
| System.Collections.IList |
Item[Int32]
Gets the formatting by index.
Declaration
public IDynamicFormat this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index |
Property Value
| Type |
|---|
| IDynamicFormat |
SyncRoot
Gets the synchronization object.
Declaration
public object SyncRoot { get; }
Property Value
| Type |
|---|
| System.Object |
Methods
Add(CoordinatePoint, CoordinatePoint, ISnippetFormat)
Creates a new dynamic format object and adds it to the list. All existing dynamic formatting in specified range will be deleted or trimmed.
Declaration
public IDynamicFormat Add(CoordinatePoint start, CoordinatePoint end, ISnippetFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| CoordinatePoint | start | Starting positions. |
| CoordinatePoint | end | End positions. |
| ISnippetFormat | format | Format to be added. |
Returns
| Type | Description |
|---|---|
| IDynamicFormat | Newly created format. |
CheckRanges()
Checks ranges of formatting.
Declaration
[Conditional("DEBUG")]
protected void CheckRanges()
Clear()
Clears all dynamic formatting.
Declaration
public void Clear()
CopyTo(Array, Int32)
Copies the list to array.
Declaration
public void CopyTo(Array array, int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | array | Destination array, |
| System.Int32 | index | Start index in destination array. |
Dispose()
Unsubscribes start and end points of formatting from events.
Declaration
public void Dispose()
GetEnumerator()
Gets the enumerator that contains list of formats.
Declaration
public IEnumerator GetEnumerator()
Returns
| Type | Description |
|---|---|
| System.Collections.IEnumerator | Enumerator. |
IndexOf(IDynamicFormat)
Returns index of the dynamic formatting.
Declaration
public int IndexOf(IDynamicFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| IDynamicFormat | format | Formatting to be found. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Index of the formatting in the internal list. |
PointInLayer(CoordinatePoint, Boolean, Boolean)
Checks whether coordinate point belongs to current layer.
Declaration
public bool PointInLayer(CoordinatePoint point, bool bIncludeBefore, bool bIncludeAfter)
Parameters
| Type | Name | Description |
|---|---|---|
| CoordinatePoint | point | Point to check. |
| System.Boolean | bIncludeBefore | If true, point at the end of region is considered as belonging to layer. |
| System.Boolean | bIncludeAfter | If true, point at the beginning of region is considered as belonging to layer. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Bool indicating whether given point belongs to current layer. |
RaiseDataChangedEvent()
Raises DataChanged event.
Declaration
protected void RaiseDataChangedEvent()
Remove(IDynamicFormat)
Removes given formatting.
Declaration
public void Remove(IDynamicFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| IDynamicFormat | format | Formatting to be deleted. |
Remove(CoordinatePoint, CoordinatePoint)
Removes all formatting in specified range.
Declaration
public void Remove(CoordinatePoint start, CoordinatePoint end)
Parameters
| Type | Name | Description |
|---|---|---|
| CoordinatePoint | start | Start of the range. |
| CoordinatePoint | end | End of the range. |
RemoveAt(Int32)
Removes formatting that contained in specified index.
Declaration
public void RemoveAt(int index)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of the formatting to be removed. |
Split(Int32, CoordinatePoint)
Splits existing format.
Declaration
protected bool Split(int index, CoordinatePoint divisionPoint)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | index | Index of the format to be splitted. |
| CoordinatePoint | divisionPoint | Point of division. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if split was successfully done, false if there was no split operation done. |
UpdateFormats()
Updates the state of start and end points of each dynamic formatting.
Declaration
public void UpdateFormats()
Events
DataChanged
Occurs when data is changed within the layer.
Declaration
public event EventHandler DataChanged
Event Type
| Type |
|---|
| System.EventHandler |