Class MacrosManager
Represents a class that helps for macros managing, including work with XML resource.
Inheritance
Implements
Inherited Members
Namespace: Syncfusion.Windows.Forms.Edit.Implementation.Config
Assembly: Syncfusion.Edit.Windows.dll
Syntax
public class MacrosManager : CollectionBase, IList, ICollection, IEnumerable
Constructors
MacrosManager()
Initializes a new instance of the
Declaration
public MacrosManager()
Properties
Item[Int32]
Gets or sets the macro by its index.
Declaration
public IMacro this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index |
Property Value
Type |
---|
IMacro |
Serializer
Gets xml serializer for macros arrays.
Declaration
protected XmlSerializer Serializer { get; }
Property Value
Type |
---|
System.Xml.Serialization.XmlSerializer |
Methods
Add(String, String)
Creates new macros and adds it to the macros manager.
Declaration
public IMacro Add(string name, string regex)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the macro. If the macro with the specified name already exists, it is removed from the list. |
System.String | regex | Regular expression string to be used instead of reference to the macro. |
Returns
Type | Description |
---|---|
IMacro | Newly created macro of type Macro. |
Add(String, String, Boolean)
Creates new macros and adds it to the macros manager.
Declaration
public IMacro Add(string name, string regex, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the macro. If the macro with the specified name already exists, it is removed from the list. |
System.String | regex | Regular expression string to be used instead of reference to the macro. |
System.Boolean | enabled | Specifies whether this macro is enabled by default. |
Returns
Type | Description |
---|---|
IMacro | Newly created macro of type Macro. |
AppendMacros(Stream)
Reads macros list from the stream and appends it to the current list.
Declaration
public void AppendMacros(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream, the data should be read from. |
AppendMacros(String)
Reads macros list from the file and appends it to the current list.
Declaration
public void AppendMacros(string strXmlFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | strXmlFilePath | Name of the file to read. |
AppendMacros(XmlReader)
Reads macros list from xmlreader and appends it to the current list.
Declaration
public void AppendMacros(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | XmlReader the data should be read from. |
Contains(String)
Checks whether macro manager contains macro with the specified name.
Declaration
public bool Contains(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the macro to be found. |
Returns
Type | Description |
---|---|
System.Boolean | True if the macro with the specified name is present in the current macro list, otherwise false. |
IndexOf(IMacro)
Searches the specified macro index in the list.
Declaration
public int IndexOf(IMacro macro)
Parameters
Type | Name | Description |
---|---|---|
IMacro | macro | Macro which's index should be found. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the specified macro in the list or -1 if the specified macro is not present in the list. |
IndexOf(String)
Searches the specified macro index in the list.
Declaration
public int IndexOf(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the macro which's index should be found. |
Returns
Type | Description |
---|---|
System.Int32 | Index of the macro with the specified name in the list or -1 if the macro with the specified name is not present in the list. |
LoadDefault()
Loads the default list of macros.
Declaration
public void LoadDefault()
LoadMacros(Stream)
Loads macros list from the stream.
Declaration
public void LoadMacros(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream the data should be read from. |
LoadMacros(String)
Loads macros list from the file.
Declaration
public void LoadMacros(string strXmlFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | strXmlFilePath | Name of the file data should be read from. |
LoadMacros(XmlReader)
Loads macros list from the XmlReader.
Declaration
public void LoadMacros(XmlReader reader)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | XmlReader the data should be read from. |
Remove(IMacro)
Removes macro from the System.Collections.CollectionBase instance.
Declaration
public void Remove(IMacro macro)
Parameters
Type | Name | Description |
---|---|---|
IMacro | macro | Macro to be removed. |
Remove(String)
Removes macro from the System.Collections.CollectionBase instance.
Declaration
public void Remove(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the macro to be removed. |
SaveMacros(Stream)
Saves macros to the stream. The data are saved in XML format.
Declaration
public void SaveMacros(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream the data should be saved to. |
SaveMacros(String)
Saves macros to Xml file.
Declaration
public void SaveMacros(string strXmlFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | strXmlFilePath | Path to Xml file where macros should be stored. |
SaveMacros(XmlWriter)
Writes macros list to the XmlWriter.
Declaration
public void SaveMacros(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | XmlWriter the data should be written to. |