Class ServerContext
Context for serializing/deserializing native types (e.g. DateTime
, double
, boolean
, etc.)
Inheritance
Inherited Members
Namespace: Innovator.Client
Assembly: Innovator.Client.dll
Syntax
public sealed class ServerContext : IServerContext, IFormatProvider, ICustomFormatter
Constructors
| Improve this Doc View SourceServerContext(Boolean)
Create a server context in either the local or UTC time zone
Declaration
public ServerContext(bool utc)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | utc | Indicates the UTC time zone should be used. Otherwise, the local time zone will be used |
ServerContext(String)
Create a server context using the specified time zone name
Declaration
public ServerContext(string timeZoneName)
Parameters
Type | Name | Description |
---|---|---|
System.String | timeZoneName |
Properties
| Improve this Doc View SourceDefaultLanguageCode
Gets the default language code configured for the Aras user
Declaration
public string DefaultLanguageCode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceDefaultLanguageSuffix
Gets the default language suffix configured for the Aras user
Declaration
public string DefaultLanguageSuffix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceLanguageCode
Gets the language code configured for the Aras user
Declaration
public string LanguageCode { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceLanguageSuffix
Gets the language suffix configured for the Aras user
Declaration
public string LanguageSuffix { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceLocale
Gets the locale configured for the user.
Declaration
public string Locale { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceTimeZone
Gets the corporate time zone ID for the Aras installation
Declaration
public string TimeZone { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Implements
Methods
| Improve this Doc View SourceAsBoolean(Object)
Converts the System.Object to a System.Boolean based on the locale and time zone
Declaration
public bool ? AsBoolean(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.Boolean> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.Boolean |
AsDateTime(Object)
Converts the System.Object representing a date in the corporate time zone to a System.DateTime in the local time zone
Declaration
public DateTime? AsDateTime(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.DateTime> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.DateTime |
AsDateTimeOffset(Object)
Converts the System.Object representing a date in the corporate time zone to a System.DateTimeOffset in the local time zone
Declaration
public DateTimeOffset? AsDateTimeOffset(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.DateTimeOffset> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.DateTimeOffset |
AsDateTimeUtc(Object)
Converts the System.Object representing a date in the corporate time zone to a System.DateTime in the UTC time zone
Declaration
public DateTime? AsDateTimeUtc(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.DateTime> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.DateTime |
AsDecimal(Object)
Converts the System.Object to a System.Decimal based on the locale and time zone
Declaration
public decimal ? AsDecimal(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.Decimal> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.Decimal |
AsDouble(Object)
Converts the System.Object to a System.Double based on the locale and time zone
Declaration
public double ? AsDouble(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.Double> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.Double |
AsInt(Object)
Converts the System.Object to a System.Int32 based on the locale and time zone
Declaration
public int ? AsInt(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.Int32> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.Int32 |
AsLong(Object)
Converts the System.Object to a System.Int64 based on the locale and time zone
Declaration
public long ? AsLong(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value. |
Returns
Type | Description |
---|---|
System.Nullable<System.Int64> |
|
Implements
Exceptions
Type | Condition |
---|---|
System.InvalidCastException | If the non-empty value cannot be converted to a System.Int64 |
Format(Object)
Serializes the value to a string. Dates are converted to the corporate time zone
Declaration
public string Format(object value)
Parameters
Type | Name | Description |
---|---|---|
System.Object | value | The value to serialize. |
Returns
Type | Description |
---|---|
System.String | A string representing the value |
Implements
| Improve this Doc View SourceFormat(String, Object, IFormatProvider)
Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information.
Declaration
public string Format(string format, object arg, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | A format string containing formatting specifications. |
System.Object | arg | An object to format. |
System.IFormatProvider | formatProvider | An object that supplies format information about the current instance. |
Returns
Type | Description |
---|---|
System.String | The string representation of the value of |
Implements
GetFormat(Type)
Returns an object that provides formatting services for the specified type.
Declaration
public object GetFormat(Type formatType)
Parameters
Type | Name | Description |
---|---|---|
System.Type | formatType | An object that specifies the type of format object to return. |
Returns
Type | Description |
---|---|
System.Object | An instance of the object specified by |