In This Article

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)

Represents a folder that can contain ICodeSnippetProvider objects and other child folders.

public CodeSnippetFolder(string name)
Parameter Type Description
name string

The name of the folder.

Properties

Folders

The collection of child folders.

public IList<ICodeSnippetFolder> Folders { get; }

Property Value

IList<ICodeSnippetFolder>

Items

The collection of code snippet metadata items in the folder.

public IList<ICodeSnippetMetadata> Items { get; }

Property Value

IList<ICodeSnippetMetadata>

Name

The name of the folder.

public string Name { get; set; }

Property Value

string

Tag

The object that contains user-defined data about the object.

public object? Tag { get; set; }

Property Value

object

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 CSharp, VB, or XML.

Returns

ICodeSnippetFolder

Inherited Members

Extension Methods