Class Factory
Class for generating connection to an Aras Innovator instance
Inheritance
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public static class Factory
Examples
using Innovator.Client;
var conn = Factory.GetConnection("URL", "USER_AGENT");
conn.Login(new ExplicitCredentials("DATABASE", "USER_NAME", "PASSWORD"));
Properties
| Improve this Doc View SourceDefaultItemFactory
Gets or sets the default IItemFactory to use with new connections
Declaration
public static IItemFactory DefaultItemFactory { get; set; }
Property Value
Type | Description |
---|---|
IItemFactory | The default IItemFactory to use with new connections. |
ImageBufferSize
How many images to buffer in memory when downloading image files. This cache is used by the AsFile(IReadOnlyProperty, IConnection, Boolean) extension method.
Declaration
public static long ImageBufferSize { get; set; }
Property Value
Type | Description |
---|---|
System.Int64 |
LogListener
Gets or sets the default log listener for all server communication
Declaration
public static Action<int, string, IEnumerable<KeyValuePair<string, object>>> LogListener { get; set; }
Property Value
Type | Description |
---|---|
System.Action<System.Int32, System.String, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, System.Object>>> | The default log listener for all server communication |
See Also
Methods
| Improve this Doc View SourceGetConnection(ConnectionPreferences)
Gets an HTTP connection to an innovator instance at the given URL
Declaration
public static IRemoteConnection GetConnection(ConnectionPreferences preferences)
Parameters
Type | Name | Description |
---|---|---|
ConnectionPreferences | preferences | Object containing preferences for the connection |
Returns
Type | Description |
---|---|
IRemoteConnection | A new IRemoteConnection object |
Examples
Create a new connection using the default stored connection
var pref = SavedConnections.Load().Default;
var conn = Factory.GetConnection(pref);
|
Improve this Doc
View Source
GetConnection(ConnectionPreferences, Boolean)
Asynchronously gets an HTTP connection to an innovator instance (or proxy) at the given URL
Declaration
public static IPromise<IRemoteConnection> GetConnection(ConnectionPreferences preferences, bool async)
Parameters
Type | Name | Description |
---|---|---|
ConnectionPreferences | preferences | Object containing preferences for the connection |
System.Boolean | async | Whether or not to return the connection asynchronously. This is important as an HTTP request must be issued to determine the type of connection to create |
Returns
Type | Description |
---|---|
IPromise<IRemoteConnection> | A promise to return a connection object |
GetConnection(String, ConnectionPreferences)
Gets an HTTP connection to an innovator instance (or proxy) at the given URL
Declaration
public static IRemoteConnection GetConnection(string url, ConnectionPreferences preferences)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | URL of the innovator instance (or proxy) |
ConnectionPreferences | preferences | Object containing preferences for the connection |
Returns
Type | Description |
---|---|
IRemoteConnection | A connection object |
GetConnection(String, ConnectionPreferences, Boolean)
Asynchronously gets an HTTP connection to an innovator instance (or proxy) at the given URL
Declaration
public static IPromise<IRemoteConnection> GetConnection(string url, ConnectionPreferences preferences, bool async)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | URL of the innovator instance (or proxy) |
ConnectionPreferences | preferences | Object containing preferences for the connection |
System.Boolean | async | Whether or not to return the connection asynchronously. This is important as an HTTP request must be issued to determine the type of connection to create |
Returns
Type | Description |
---|---|
IPromise<IRemoteConnection> | A promise to return a connection object |
GetConnection(String, String)
Gets an HTTP connection to an innovator instance (or proxy) at the given URL
Declaration
public static IRemoteConnection GetConnection(string url, string userAgent)
Parameters
Type | Name | Description |
---|---|---|
System.String | url | URL of the innovator instance (or proxy) |
System.String | userAgent | User agent string to use for the connection |
Returns
Type | Description |
---|---|
IRemoteConnection | A connection object |
Examples
using Innovator.Client;
var conn = Factory.GetConnection("URL", "USER_AGENT");
conn.Login(new ExplicitCredentials("DATABASE", "USER_NAME", "PASSWORD"));