CodeSnippetFolder Class
Represents a folder that can contain ICodeSnippetProvider objects and other child folders.
public class CodeSnippetFolder : ICodeSnippetFolder
- Inheritance:
- object object
- Implements:
- ICodeSnippetFolder
Constructors
CodeSnippetFolder(string)
Initializes a new instance of the CodeSnippetFolder
class.
public CodeSnippetFolder(string name)
Parameter | Type | Description |
---|---|---|
name | string | The name of the folder. |
Properties
Folders
Gets the collection of child folders.
public IList<ICodeSnippetFolder> Folders { get; }
Property Value
- IList<ICodeSnippetFolder>:
The collection of child folders.
Items
Gets the collection of code snippet metadata items in the folder.
public IList<ICodeSnippetMetadata> Items { get; }
Property Value
- IList<ICodeSnippetMetadata>:
The collection of code snippet metadata items in the folder.
Name
Gets or sets the name of the folder.
Tag
Gets or sets the object that contains user-defined data about the object.
public object Tag { get; set; }
Property Value
Remarks
Any type derived from the object class can be assigned to this property.
Methods
FindItemByShortcut(string, bool)
Recursively searches for an item with the specified shortcut.
public ICodeSnippetMetadata FindItemByShortcut(string shortcut, bool isCaseSensitive)
Parameter | Type | Description |
---|---|---|
shortcut | string | The shortcut text. |
isCaseSensitive | bool | Whether the comparison should be case-sensitive. |
Returns
- ICodeSnippetMetadata:
The ICodeSnippetMetadata that was found, if any.
LoadFrom(string, string)
Creates a CodeSnippetFolder
that pre-loads all snippet files found in the specified file system path.
public static ICodeSnippetFolder LoadFrom(string path, string language)
Parameter | Type | Description |
---|---|---|
path | string | The file system path to recursively examine for snippet files. |
language | string | The language of snippets to load, if looking for a specific language. Options are |