Class SavedConnections
Access information about connection preferences that has been persisted to disk
Inheritance
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public class SavedConnections : IEnumerable<ConnectionPreferences>, IEnumerable
Examples
Create a new connection using the default stored connection
var pref = SavedConnections.Load().Default;
var conn = Factory.GetConnection(pref);
Constructors
| Improve this Doc View SourceSavedConnections()
Initializes a new instance of the SavedConnections class.
Declaration
public SavedConnections()
Properties
| Improve this Doc View SourceDefault
Gets or sets the default preference.
Declaration
public ConnectionPreferences Default { get; set; }
Property Value
Type | Description |
---|---|
ConnectionPreferences | The default preference. |
Item[String]
Gets or sets the ConnectionPreferences with the specified name.
Declaration
public ConnectionPreferences this[string name] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name. |
Property Value
Type | Description |
---|---|
ConnectionPreferences |
Keys
Gets the names of all applicable preferences.
Declaration
public IEnumerable<string> Keys { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> | The names of all applicable preferences. |
Methods
| Improve this Doc View SourceAdd(ConnectionPreferences)
Adds the specified ConnectionPreferences.
Declaration
public void Add(ConnectionPreferences value)
Parameters
Type | Name | Description |
---|---|---|
ConnectionPreferences | value | The ConnectionPreferences to store. |
CreateReader()
Creates a System.Xml.XmlReader for reading the preference data.
Declaration
public XmlReader CreateReader()
Returns
Type | Description |
---|---|
System.Xml.XmlReader | An System.Xml.XmlReader for reading the preference data |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<ConnectionPreferences> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<ConnectionPreferences> | A System.Collections.Generic.IEnumerator<T> that can be used to iterate through the collection. |
Implements
Load(Stream)
Initializes a new SavedConnections instance from the stream
data.
Declaration
public static SavedConnections Load(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream to load data from. |
Returns
Type | Description |
---|---|
SavedConnections | A new SavedConnections instance |
Load(TextReader)
Initializes a new SavedConnections instance from the textReader
data.
Declaration
public static SavedConnections Load(TextReader textReader)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextReader | textReader | The System.IO.TextReader to load data from. |
Returns
Type | Description |
---|---|
SavedConnections | A new SavedConnections instance |
Load(String)
Initializes a new SavedConnections instance from the uri
.
Declaration
public static SavedConnections Load(string uri)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | The URI to load data from. |
Returns
Type | Description |
---|---|
SavedConnections | A new SavedConnections instance |
Parse(String)
Initializes a new SavedConnections instance from the xml
.
Declaration
public static SavedConnections Parse(string xml)
Parameters
Type | Name | Description |
---|---|---|
System.String | xml | The XML data to parse. |
Returns
Type | Description |
---|---|
SavedConnections | A new SavedConnections instance |
Save(Stream)
Saves the preferences to the specified System.IO.Stream.
Declaration
public void Save(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The System.IO.Stream to save the preferences to. |
Save(TextWriter)
Saves the preferences to the specified System.IO.TextWriter.
Declaration
public void Save(TextWriter textWriter)
Parameters
Type | Name | Description |
---|---|---|
System.IO.TextWriter | textWriter | The System.IO.TextWriter to save the preferences to. |
Save(XmlWriter)
Saves the preferences to the specified System.Xml.XmlWriter.
Declaration
public void Save(XmlWriter writer)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlWriter | writer | The System.Xml.XmlWriter to save the preferences to. |
ToString()
Returns an XML System.String that represents serialized data.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A XML System.String that represents serialized data. |
Overrides
TryGetValue(String, out ConnectionPreferences)
Tries the get a ConnectionPreferences by name.
Declaration
public bool TryGetValue(string name, out ConnectionPreferences value)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the ConnectionPreferences. |
ConnectionPreferences | value | The value. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Explicit Interface Implementations
| Improve this Doc View SourceIEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An System.Collections.IEnumerator object that can be used to iterate through the collection. |