다음을 통해 공유


ProvideLanguageCodeExpansionAttribute.SearchPaths Property

Gets or sets a semicolon-delimited string containing the default paths to search for snippets.

Namespace:  Microsoft.VisualStudio.Shell
Assemblies:   Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
  Microsoft.VisualStudio.Shell.9.0 (in Microsoft.VisualStudio.Shell.9.0.dll)
  Microsoft.VisualStudio.Shell (in Microsoft.VisualStudio.Shell.dll)

Syntax

‘선언
Public Property SearchPaths As String
    Get
    Set
‘사용 방법
Dim instance As ProvideLanguageCodeExpansionAttribute
Dim value As String

value = instance.SearchPaths

instance.SearchPaths = value
public string SearchPaths { get; set; }
public:
property String^ SearchPaths {
    String^ get ();
    void set (String^ value);
}
member SearchPaths : string with get, set
function get SearchPaths () : String
function set SearchPaths (value : String)

Property Value

Type: System.String
Returns a semicolon-delimited string containing the paths to search for snippets.

Remarks

The paths specified by this option are a semi-colon-delimited list and are used to look for snippets if the index file cannot be found. The search paths can contain certain substitution variables; see Support for Code Snippets (Managed Package Framework) for details.

This property is available to any language service implementation.

The registry entry looks like this:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\[X.Y]\Languages\Language Services\CodeExpansions\
  [Language Name]\
    Paths\
      (Default)       = reg_sz:
      [Language Name] = reg_sz: [SearchPaths]

Examples

    [ProvideCodeExpansion(typeof(MyLanguageService),            // Required
                            MyConstants.languageName,           // Required
                            MyConstants.languageNameResourceID, // Required
                            MyConstants.languageIdentifier,     // Required
                            MyConstants.snippetsIndexFilePath,  // Required
        // Optional code expansion properties
        SearchPaths = @"%InstallRoot%\MyLanguage\Snippets\%LCID%\Snippets;" +
                      @"\%MyDocs%\Code Snippets\MyLanguage\My Code Snippets";
                         )]

.NET Framework Security

See Also

Reference

ProvideLanguageCodeExpansionAttribute Class

ProvideLanguageCodeExpansionAttribute Members

Microsoft.VisualStudio.Shell Namespace

Other Resources

Support for Code Snippets (Managed Package Framework)