CodeSnippetSerializer Class
Provides a class that can serialize and deserialize ICodeSnippet objects to/from XML.
public class CodeSnippetSerializer
- Inheritance:
- object object
Constructors
CodeSnippetSerializer()
Initializes an instance of the class.
public CodeSnippetSerializer()
Methods
LoadFromFile(string)
Loads a collection of ICodeSnippet objects from a file.
public IEnumerable<ICodeSnippet> LoadFromFile(string path)
Parameter | Type | Description |
---|---|---|
path | string | The full path to the file. |
Returns
- IEnumerable<ICodeSnippet>:
The collection of ICodeSnippet objects that were loaded.
LoadFromStream(Stream)
Loads a collection of ICodeSnippet objects from a Stream.
public IEnumerable<ICodeSnippet> LoadFromStream(Stream stream)
Parameter | Type | Description |
---|---|---|
stream | Stream | The Stream from which to load. |
Returns
- IEnumerable<ICodeSnippet>:
The collection of ICodeSnippet objects that were loaded.
SaveToFile(string, params ICodeSnippet[])
Saves one or more ICodeSnippet objects to a file.
public void SaveToFile(string path, params ICodeSnippet[] codeSnippets)
Parameter | Type | Description |
---|---|---|
path | string | The full path to the file. |
codeSnippets | ICodeSnippet[] | The ICodeSnippet objects to serialize. |
SaveToStream(Stream, params ICodeSnippet[])
Saves one or more ICodeSnippet objects to a Stream.
public void SaveToStream(Stream stream, params ICodeSnippet[] codeSnippets)
Parameter | Type | Description |
---|---|---|
stream | Stream | The Stream to write to. |
codeSnippets | ICodeSnippet[] | The ICodeSnippet objects to serialize. |