# SnippetServer class

Namespace: [Grasshopper2.Framework](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.framework.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public static class SnippetServer
```

Maintains all loaded snippets.

## Properties

- [Folders](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/folders.md): (static) Gets all folders currently tracked by this server.
- [Snippets](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/snippets.md): (static) Gets all folders currently tracked by this server.
- [UserCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/usercount.md): (static) Gets the number of snippets across all user folders. Snippets shipped with the installation are not counted.
- [UserSnippets](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/usersnippets.md): (static) Gets all snippets which come from user folders, i.e. folders added with `isUser: true`. Snippets shipped with the installation are excluded.

## Methods

- [AddFolder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/addfolder.md): (static) Add a folder containing snippets to this server. The folder is scanned for *.ghz files and a watcher is installed to keep the snippet list in sync with the file system. Duplicate folders are silently ignored.
- [FindById](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/findbyid.md): (static) Look up a tracked snippet by its [Snippet.Id](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/id.md). Returns null if no match is found.
- [RemoveFolder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/removefolder.md): (static) Remove a folder from this server. Its watcher is disposed and its tracked snippets are forgotten.
- [Search](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/search.md): (static) Search all snippets and append them to a result.

## Events

- [SnippetsChanged](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippetserver/snippetschanged.md): (static) Raised whenever the tracked folder list changes, or any folder's snippet list changes.
