In This Article

CodeSnippet Class

Represents a code snippet.

public class CodeSnippet : ICodeSnippet, ICodeSnippetMetadata
Inheritance:
object object
Implements:
ICodeSnippet ICodeSnippetMetadata

Constructors

CodeSnippet()

Initializes an instance of the class.

public CodeSnippet()

Properties

Author

The name of the code snippet author.

public string? Author { get; set; }

Property Value

string

CodeDelimiter

The character used to describe literals and objects in the code.

public string? CodeDelimiter { get; set; }

Property Value

string

CodeKind

A CodeSnippetKind indicating the kind of code contained by the snippet.

public CodeSnippetKind CodeKind { get; set; }

Property Value

CodeSnippetKind

CodeLanguage

The language in which the snippet's code is written.

public string? CodeLanguage { get; set; }

Property Value

string

CodeText

The code that is inserted when the code snippet is activated.

public string? CodeText { get; set; }

Property Value

string

Declarations

The collection of declarations.

public IList<ICodeSnippetDeclaration> Declarations { get; }

Property Value

IList<ICodeSnippetDeclaration>

Description

Descriptive information about the code snippet contents.

public string? Description { get; set; }

Property Value

string

HelpUrl

A URL that provides more information about the code snippet.

public string? HelpUrl { get; set; }

Property Value

string

ImportedNamespaces

The collection of imported namespaces.

public IList<string> ImportedNamespaces { get; }

Property Value

IList<string>

Keywords

The collection of keywords that describe the code snippet.

public IList<string> Keywords { get; }

Property Value

IList<string>

References

The collection of assembly references.

public IList<ICodeSnippetAssemblyReference> References { get; }

Property Value

IList<ICodeSnippetAssemblyReference>

Shortcut

The shortcut text used to insert the code snippet.

public string? Shortcut { get; set; }

Property Value

string

SnippetTypes

The types of actions that can be performed by the code snippet.

public CodeSnippetTypes SnippetTypes { get; set; }

Property Value

CodeSnippetTypes

Tag

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

public object? Tag { get; set; }

Property Value

object

Title

The code snippet title.

public string? Title { get; set; }

Property Value

string

Inherited Members

Extension Methods