Class CodeSnippetsManager
Represents a class that manages to work with code snippets.
Inheritance
Inherited Members
Namespace: Syncfusion.Windows.Forms.Edit.Utils.CodeSnippets
Assembly: Syncfusion.Edit.Windows.dll
Syntax
public class CodeSnippetsManager
Constructors
CodeSnippetsManager(StreamEditControl)
Initializes a new instance of the CodeSnippetsManager class.
Declaration
public CodeSnippetsManager(StreamEditControl control)
Parameters
Type | Name | Description |
---|---|---|
StreamEditControl | control | Underlying stream edit control. |
Fields
CodeSnippetActivating
Occurs when code snippet is to be activated.
Declaration
public CancellableCodeSnippetsEventHandler CodeSnippetActivating
Field Value
CodeSnippetDeactivating
Occurs when code snippet is to be deactivated.
Declaration
public CodeSnippetsEventHandler CodeSnippetDeactivating
Field Value
CodeSnippetTemplateTextChanging
Occurs when text of template member is to be changed.
Declaration
public CodeSnippetTemplateTextChangingEventHandler CodeSnippetTemplateTextChanging
Field Value
NewSnippetMemberHighlighting
Occurs when new snippet member has to be highlighted.
Declaration
public NewSnippetMemberHighlightingEventHandler NewSnippetMemberHighlighting
Field Value
Properties
Activated
Gets or sets a value indicating whether code snippets manager is activated and processes keys.
Declaration
public bool Activated { get; set; }
Property Value
Type |
---|
System.Boolean |
CursorEndPoint
Gets or sets place to put cursor to after snippet deactivation.
Declaration
public IParsePoint CursorEndPoint { get; set; }
Property Value
Type |
---|
IParsePoint |
EndPoint
Gets or sets end parse point of current active snippet.
Declaration
public IParsePoint EndPoint { get; set; }
Property Value
Type |
---|
IParsePoint |
SnippetMembers
Gets the list of current snippet members.
Declaration
public ArrayList SnippetMembers { get; }
Property Value
Type |
---|
System.Collections.ArrayList |
StartPoint
Gets or sets the start parse point of current active snippet.
Declaration
public IParsePoint StartPoint { get; set; }
Property Value
Type |
---|
IParsePoint |
Methods
Activate(CodeSnippet, String)
Helps to activates code snippets manager.
Declaration
public void Activate(CodeSnippet snippet, string selected)
Parameters
Type | Name | Description |
---|---|---|
CodeSnippet | snippet | Code snippet. |
System.String | selected | Selected text. |
AddCodeSnippet(String, ArrayList, String)
Adds new code snippet to current language.
Declaration
public void AddCodeSnippet(string title, ArrayList literals, string code)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | Title of code snippet. |
System.Collections.ArrayList | literals | List of literals. |
System.String | code | Code of snippet. |
ChangeTemplateText(String, String)
Changes text of all template members with defined name.
Declaration
public void ChangeTemplateText(string memberName, string newText)
Parameters
Type | Name | Description |
---|---|---|
System.String | memberName | Name of template member. |
System.String | newText | New text. |
DeleteSnippetMemberText()
Deletes currently active highlighted text of code snippet manager.
Declaration
public bool DeleteSnippetMemberText()
Returns
Type | Description |
---|---|
System.Boolean | True if succeeds. |
FindNextTemplateMember()
Finds the next template member in text and puts cursor there.
Declaration
public bool FindNextTemplateMember()
Returns
Type | Description |
---|---|
System.Boolean | True if succeeds, otherwise false. |
GetSnippetByTitle(String)
Gets code snippet by its title.
Declaration
public CodeSnippet GetSnippetByTitle(string title)
Parameters
Type | Name | Description |
---|---|---|
System.String | title | Title of code snippet that has to be found. |
Returns
Type | Description |
---|---|
CodeSnippet | Needed code snippet or null if there's no snippet with given name. |
MarkCodeSnippet(Graphics)
Marks area of code snippet.
Declaration
public void MarkCodeSnippet(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Graphics | g | Graphics object to draw at. |
ProcessKeys(KeyEventArgs)
Processes keys.
Declaration
public void ProcessKeys(KeyEventArgs keys)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyEventArgs | keys | Keys enum to process. |
ProcessKeys(KeyPressEventArgs)
Processes keys.
Declaration
public void ProcessKeys(KeyPressEventArgs keys)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Forms.KeyPressEventArgs | keys | Keys enum to process. |