Native SDK for .NET Quick Reference
This is a quick reference for the InterSystems IRIS Native SDK for .NET, providing information on the following extension classes in InterSystems.Data.IRISClient.ADO:
-
Class IRIS provides the main functionality of the Native SDK.
-
Class IRISIterator provides methods to navigate a global array.
-
Class IRISList provides support for InterSystems $LIST serialization.
-
Class IRISObject provides methods to work with Gateway inverse proxy objects.
All of these classes are part of the InterSystems ADO.NET Managed Provider (InterSystems.Data.IRISClient.ADO). They access the database through a standard .NET connection, and can be used without any special setup or installation procedures.
This reference is intended as a convenience for readers of this book, but it is not the definitive reference for the Native SDK. For the most complete and up-to-date information, see the online class documentation.
All methods listed in the following sections will throw an exception on encountering any kind of error. The subscript argument Object[] args is always defined as params object[].
Class IRIS
Class IRIS is a member of InterSystems.Data.IRISClient.ADO (the InterSystems ADO.NET Managed Provider).
IRIS has no public constructors. Instances of IRIS are created by calling static method IRIS.CreateIRIS().
IRIS Method Details
ADO.IRIS.ClassMethodBool() calls an ObjectScript class method, passing zero or more arguments and returning an instance of bool?.
bool ClassMethodBool(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodBytes() calls an ObjectScript class method, passing zero or more arguments and returning an instance of byte[].
byte[] ClassMethodBytes(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodDouble() calls an ObjectScript class method, passing zero or more arguments and returning an instance of double?.
double ClassMethodDouble(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodIRISList() calls an ObjectScript class method, passing zero or more arguments and returning an instance of IRISList.
IRISList ClassMethodIRISList(string className, string methodName, params object[] args)
This method is equivalent to newList=(IRISList) ClassMethodBytes(className, methodName, args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodLong() calls an ObjectScript class method, passing zero or more arguments and returning an instance of long?.
long ClassMethodLong(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodObject() calls an ObjectScript class method, passing zero or more arguments and returning an instance of object. If the returned object is a valid OREF (for example, if %New() was called), ClassMethodObject() will generate and return an inverse proxy object (an instance of IRISObject) for the referenced object. See “Using .NET Inverse Proxy Objects” for details and examples.
object ClassMethodObject(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
ADO.IRIS.ClassMethodStatusCode() tests whether a class method that returns an ObjectScript $Status object would throw an error if called with the specified arguments. If the call would fail, this method throws an IRISException error containing the ObjectScript $Status error status number and message.
void ClassMethodStatusCode(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
This is an indirect way to catch exceptions when using ClassMethod[type] calls. If the call would run without error, this method returns without doing anything, meaning that you can safely make the call with the specified arguments.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodString() calls an ObjectScript class method, passing zero or more arguments and returning an instance of string.
string ClassMethodString(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.ClassMethodVoid() calls an ObjectScript class method with no return value, passing zero or more arguments.
void ClassMethodVoid(string className, string methodName, params object[] args)
parameters:
-
className — fully qualified name of the class to which the called method belongs.
-
methodName — name of the class method.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.Close() closes the IRIS object.
void Close()
ADO.IRIS.CreateIRIS() returns an instance of ADO.IRIS that uses the specified IRISConnection.
static IRIS CreateIRIS(IRISADOConnection conn)
parameters:
-
conn — an instance of IRISConnection.
See “Introduction to Global Arrays” for more information and examples.
ADO.IRIS.FunctionBool() calls an ObjectScript function, passing zero or more arguments and returning an instance of bool?.
bool FunctionBool(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.FunctionBytes() calls an ObjectScript function, passing zero or more arguments and returning an instance of byte[].
byte[] FunctionBytes(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.FunctionDouble() calls an ObjectScript function, passing zero or more arguments and returning an instance of double?.
double FunctionDouble(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.FunctionInt() calls an ObjectScript function, passing zero or more arguments and returning an instance of long?.
long FunctionInt(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.FunctionIRISList() calls an ObjectScript function, passing zero or more arguments and returning an instance of IRISList.
IRISList FunctionIRISList(string functionName, string routineName, params object[] args)
This function is equivalent to newList=(IRISList) FunctionBytes(functionName, routineName, args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.FunctionLong() calls an ObjectScript function, passing zero or more arguments and returning an instance of Long.
long FunctionLong(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.FunctionObject() calls an ObjectScript function, passing zero or more arguments and returning an instance of object. If the returned object is a valid OREF, FunctionObject() will generate and return an inverse proxy object (an instance of IRISObject) for the referenced object. See “Using .NET Inverse Proxy Objects” for details and examples.
object FunctionObject(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.FunctionString() calls an ObjectScript function, passing zero or more arguments and returning an instance of string.
string FunctionString(string functionName, string routineName, params object[] args)
parameters:
-
functionName — name of the function to call.
-
routineName — name of the routine containing the function.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for details and examples.
ADO.IRIS.GetAPIVersion() returns the Native SDK version string.
static String GetAPIVersion()
ADO.IRIS.GetBool() gets the value of the global as a bool? (or null if node does not exist). Returns false if node value is empty string.
bool GetBool(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetBytes() gets the value of the global as a byte[] (or null if node does not exist).
byte[] GetBytes(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetDateTime() gets the value of the global as a DateTime? (or null if node does not exist).
DateTime GetDateTime(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetDouble() gets the value of the global as a double? (or null if node does not exist). Returns 0.0 if node value is empty string.
Double GetDouble(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetInt16() gets the value of the global as an Int16? (or null if node does not exist). Returns 0 if node value is empty string.
Int16 GetInt16(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetInt32() gets the value of the global as an Int32? (or null if node does not exist). Returns 0 if node value is empty string.
Int32 GetInt32(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetInt64() gets the value of the global as an Int64? (or null if node does not exist). Returns 0 if node value is empty string.
Int64 GetInt64(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetIRISIterator() returns an IRISIterator object (see “Class IRISIterator”) for the specified node with search direction set to FORWARD. See “Iterating Over a Set of Child Nodes” for more information and examples.
IRISIterator GetIRISIterator(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetIRISList() gets the value of the node as an IRISList (or null if node does not exist).
IRISList GetIRISList(String globalName, params object[] subscripts)
This is equivalent to calling newList=(IRISList) GetBytes(globalName, subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetIRISReverseIterator() returns an IRISIterator object (see “Class IRISIterator”) for the specified node with search direction set to BACKWARD. See “Iterating Over a Set of Child Nodes” for more information and examples.
IRISIterator GetIRISReverseIterator(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetObject() gets the value of the global as an Object (or null if node does not exist). See “Using .NET Inverse Proxy Objects” for details and examples.
object GetObject(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetServerVersion() returns the server version string for the current connection. This is equivalent to calling $system.Version.GetVersion() in ObjectScript.
String GetServerVersion()
ADO.IRIS.GetSingle() gets the value of the global as a Single? (Nullable<float>) or null if node does not exist. Returns 0.0 if node value is an empty string.
Single GetSingle(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetString() gets the value of the global as a string (or null if node does not exist).
Empty string and null values require some translation. An empty string "" in .NET is translated to the null string character $CHAR(0) in ObjectScript. A null in .NET is translated to the empty string in ObjectScript. This translation is consistent with the way .NET handles these values.
string GetString(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRIS.GetTLevel() gets the level of the current nested Native SDK transaction. Returns 1 if there is only a single transaction open. Returns 0 if there are no transactions open. This is equivalent to fetching the value of the $TLEVEL special variable.
int GetTLevel()
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.Increment() increments the specified global with the passed value. If there is no node at the specified address, a new node is created with value as the value. A null value is interpreted as 0. Returns the new value of the global node. See “Creating, Accessing, and Deleting Nodes” for more information and examples.
long Increment(long? value, string globalName, params object[] subscripts)
parameters:
-
value — long value to which to set this node (null value sets global to 0).
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
ADO.IRIS.IsDefined() returns a value indicating whether the specified node exists and if it contains a value. See “Testing for Child Nodes and Node Values” for more information and examples.
int IsDefined(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
return values:
-
0 — the specified node does not exist
-
1 — the node exists and has a value
-
10 — the node is valueless but has subnodes
-
11 — the node has both a value and subnodes
ADO.IRIS.Kill() deletes the global node including any descendants. See “Creating, Accessing, and Deleting Nodes” for more information and examples.
void Kill(string globalName, params object[] subscripts)
parameters:
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
ADO.IRIS.Lock() locks the global for a Native SDK transaction, and returns true on success. Note that this method performs an incremental Lock and not the implicit Unlock before Lock feature that is also offered in ObjectScript.
bool Lock(string lockMode, int timeout, string globalName, params object[] subscripts)
parameters:
-
lockMode — Character S for shared Lock, E for escalating Lock, or SE for both. Default is empty string (exclusive and non-escalating).
-
timeout — number of seconds to wait when attempting to acquire the Lock.
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.Procedure() calls a procedure, passing zero or more arguments. Does not return a value.
void Procedure(string procedureName, string routineName, params object[] args)
parameters:
-
procedureName — name of the procedure to call.
-
routineName — name of the routine containing the procedure.
-
args — zero or more arguments of supported types.
See “Calling ObjectScript Methods and Functions” for more information and examples.
ADO.IRIS.ReleaseAllLocks() is a Native SDK transaction method that releases all locks associated with the session.
void ReleaseAllLocks()
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.Set() sets the current node to a value of a supported datatype (or "" if the value is null). If there is no node at the specified node address, a new node will be created with the specified value. See “Creating, Accessing, and Deleting Nodes” for more information.
void Set(bool? value, string globalName, params object[] subscripts)
void Set(byte[] value, string globalName, params object[] subscripts)
void Set(DateTime? value, string globalName, params object[] subscripts)
void Set(Double? value, string globalName, params object[] subscripts)
void Set(Int16? value, string globalName, params object[] subscripts)
void Set(Int32? value, string globalName, params object[] subscripts)
void Set(Int64? value, string globalName, params object[] subscripts)
void Set(IRISList value, String globalName, params object[] subscripts)
void Set(object value, string globalName, params object[] subscripts)
void Set(Single? value, string globalName, params object[] subscripts)
void Set(string value, string globalName, params object[] subscripts)
void Set(System.IO.MemoryStream value, string globalName, params object[] subscripts)
parameters:
-
value — value of a supported datatype (null value sets global to "").
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
See “Class IRIS Supported Datatypes” for related information.
The following datatypes have some extra features:
-
string — empty string and null values require some translation. An empty string "" in .NET is translated to the null string character $CHAR(0) in ObjectScript. A null in .NET is translated to the empty string in ObjectScript. This translation is consistent with the way .NET handles these values.
-
System.IO.MemoryStream — an instance of an object that implements MemoryStream will be stored as a byte[] when set as the global value. A null in .NET is translated to the empty string in ObjectScript. Use getBytes() to retrieve the value, then initialize a MemoryStream with the returned byte [] value.
ADO.IRIS.TCommit() commits the current Native SDK transaction.
void TCommit()
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.TRollback() rolls back all open Native SDK transactions in the session.
void TRollback()
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.TRollbackOne() rolls back the current level Native SDK transaction only. If this is a nested transaction, any higher-level transactions will not be rolled back.
void TRollbackOne()
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.TStart() starts/opens a Native SDK transaction.
void TStart()
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
ADO.IRIS.Unlock() unlocks the global in a Native SDK transaction. This method performs an incremental Unlock, not the implicit Unlock-before-Lock feature that is also offered in ObjectScript.
void Unlock(string lockMode, string globalName, params object[] subscripts)
parameters:
-
lockMode — Character S for shared Lock, E for escalating Lock, or SE for both. Default is empty string (exclusive and non-escalating).
-
globalName — global name.
-
subscripts — zero or more subscripts specifying the target node.
This method uses the Native SDK transaction model, and is not compatible with ADO.NET/SQL transaction methods. Never mix the two transaction models. See “Transactions and Locking” for more information and examples.
Class IRISIterator
Class IRISIterator is a member of InterSystems.Data.IRISClient.ADO (the InterSystems ADO.NET Managed Provider).
Instances of IRISIterator are created by calling one of the following IRIS methods:
-
ADO.IRIS.GetIRISIterator() — Returns an IRISIterator instance set to forward iteration.
-
ADO.IRIS.GetIRISReverseIterator() — Returns an IRISIterator instance set to backward iteration.
See “Iterating Over a Set of Child Nodes” for more information and examples.
This class implements required IEnumerator method System.Collections.IEnumerator.GetEnumerator()Opens in a new tab, which is invoked when the iterator is used in a foreach loop.
All methods listed in the following sections will throw an exception on encountering any kind of error.
IRISIterator Method and Property Details
ADO.IRISIterator.Current gets the value of the node at the current iterator position. In a foreach loop, this value is also assigned to the current loop variable. See “Iteration in Conditional Loops” for more information and examples.
object Current [get]
ADO.IRISIterator.CurrentSubscript gets the lowest level subscript for the node at the current iterator position. For example, if the iterator points to node ^myGlobal(23,"somenode"), the returned value will be "somenode". See “Iteration in Conditional Loops” for more information and examples.
object CurrentSubscript [get]
ADO.IRISIterator.MoveNext() implements System.Collections.IEnumerator. It returns true if the next value was retrieved, false if there are no more values. See “Iteration in Conditional Loops” for more information and examples.
bool MoveNext()
ADO.IRISIterator.Reset() can be called after completing a foreach loop to reset the iterator to its starting position, allowing it to be used again. See “Iteration in Conditional Loops” for more information and examples.
void Reset()
ADO.IRISIterator.StartFrom() sets the iterator's starting position to the specified subscript. The subscript is an arbitrary starting point, and does not have to specify an existing node. See “Iterating Over a Set of Child Nodes” for more information and examples.
void StartFrom(Object subscript)
Class IRISList
Class IRISList is a member of InterSystems.Data.IRISClient.ADO (the InterSystems ADO.NET Managed Provider). It implements a .NET interface for InterSystems $LIST serialization. In addition to the IRISList constructors (described in the following section), it is also returned by the following ADO.IRIS methods: classMethodIRISList(), functionIRISList(), getIRISList().
IRISList Constructors
Constructor ADO.IRISList.IRISList() has the following signatures:
public IRISList()
public IRISList(IRISList list)
public IRISList(byte[] buffer, int length)
parameters:
-
list — instance of IRISList to be copied
-
buffer — buffer to be allocated
-
length — initial buffer size to be allocated
Instances of IRISList can be created in the following ways:
IRISList list = new IRISList();
Create a copy of the IRISList instance specified by argument list.
IRISList listcopy = new IRISList(myOtherList)
Construct an instance from a $LIST formatted byte array, such as that returned by IRIS.GetBytes(). The constructor takes a buffer of size length:
byte[] listBuffer = myIris.GetBytes("myGlobal",1);
IRISList listFromByte = new IRISList(listBuffer, listBuffer.length);
The returned list uses the buffer (not a copy) until changes to the list are visible in the buffer and a resize is required.
IRISList Method Details
ADO.IRISList.Add() appends an Object of any supported type to the end of the IRISList. If value is an IRISList, it will be added as a single element (IRISList instances are never concatenated).
void Add(Object value)
parameters:
-
value — Object value. The following types are supported: Int16, Int32, Int64, bool, Single, Double, string, byte[], IRISList.
Add() always appends an IRISList instance as a single object. However, you can use IRISList.ToArray() to convert an IRISList to an array, and then call Add() on each element separately.
ADO.IRISList.AddRange() appends each element of a collection to the end of the list as it is returned by the collection iterator. An exception will be thrown if any element is not one of the supported types.
void AddRange(System.Collections.IList list)
parameters:
-
list — a collection containing only elements of the following types: Int16, Int32, Int64, bool, Single, Double, string, byte[], IRISList.
See “Class IRIS Supported Datatypes” for related information.
ADO.IRISList.Clear() resets the list by removing all elements from the list.
void Clear()
ADO.IRISList.Count() iterates over the list and returns the number of elements encountered.
int Count()
ADO.IRISList.DateToHorolog() converts the date property of a DateTime value to an int representing the day field of a $Horolog string. Also see HorologToDate().
static int DateToHorolog(DateTime value)
parameters:
-
value — DateTime value to convert.
ADO.IRISList.DateToPosix() converts a Time object to the time field of a $Horolog string.
static long DateToPosix(DateTime Value)
parameters:
-
Value — DateTime value to convert.
ADO.IRISList.Equals() compares the specified list with this instance of IRISList, and returns true if they are identical. To be equal, both lists must contain the same number of elements in the same order with identical serialized values.
override bool Equals(Object list)
parameters:
-
list — instance of IRISList to compare.
ADO.IRISList.Get() returns the element at index as Object. Throws IndexOutOfRangeException if the index is less than 1 or past the end of the list.
Object Get(int index)
parameters:
-
index — integer specifying the list element to be retrieved.
ADO.IRISList.GetList() gets the element at index as an IRISList. Throws IndexOutOfRangeException if the index is less then 1 or past the end of the list
IRISList GetList(int index)
parameters:
-
index — integer specifying the list element to return
Throws IndexOutOfRangeException if the index is less then 1 or past the end of the list.
ADO.IRISList.HorologToDate() converts the day field of a $Horolog string to a DateTime value. Also see DateToHorolog().
static DateTime HorologToDate(int HorologValue)
parameters:
-
HorologValue — int representing the day field of a $Horolog string.
ADO.IRISList.HorologToTime() converts the time field of a $Horolog string to a TimeSpan value. Also see TimeToHorolog().
static TimeSpan HorologToTime(int HorologValue)
parameters:
-
HorologValue — int representing the time field of a $Horolog string. The date field will be zeroed out (set to the epoch), so a TimeSpan with a milliseconds value outside the range 0L to 86399999L does not round trip.
ADO.IRISList.PosixToDate() converts a %Library.PosixTimeOpens in a new tab value to a DateTime. Also see DateToPosix().
static DateTime PosixToDate(long PosixValue)
parameters:
-
PosixValue — the %PosixTimeOpens in a new tab value (a 64-bit signed integer).
ADO.IRISList.Remove() removes the element at index from the list. Returns true if the element existed and was removed, false otherwise. This method can be expensive, since it will usually have to reallocate the list.
bool Remove(int index)
parameters:
-
index — integer specifying the list element to remove.
ADO.IRISList.Set() sets or replaces the list element at index with value. If value is an array, each array element is inserted into the list, starting at index, and any existing list elements after index are shifted to make room for the new values. If index is beyond the end of the list, value will be stored at index and the list will be padded with nulls up to that position.
void Set(int index, Object value)
void Set(int index, object[] value)
Throws IndexOutOfRangeException if index is less than 1. All elements must be of the following types: Int16, Int32, Int64, bool, Single, Double, string, byte[], IRISList.
parameters:
-
index — integer indicating the list element to be set or replaced
-
value — Object value or object[] array to insert at index
ADO.IRISList.Size() returns the byte length of the serialized value for this IRISList.
int Size()
ADO.IRISList.SubList() returns a new IRISList containing the elements in the closed range [from, to]. Throws IndexOutOfRangeException if from is greater than Count() or to is less than from.
IRISList SubList(int from, int to)
parameters:
-
from — index of first element to add to the new list.
-
to — index of last element to add to the new list.
ADO.IRISList.TimeToHorolog() converts a DateTime value to the time field of a $Horolog value. Also see HorologToTime().
static int TimeToHorolog(DateTime value)
parameters:
-
value — DateTime to be converted.
ADO.IRISList.ToArray() returns an array of the given type containing all of the elements in this list. If the list is empty, a zero length array will be returned.
IMPORTANT: This method should be used only if all elements can be coerced to be of the same type.
Object[] ToArray()
ADO.IRISList.ToList() returns a List of the given type containing all of the elements in this IRISList. If the list is empty, a zero length List will be returned.
List<Object> ToList()
ADO.IRISList.ToString() returns a printable representation of the list.
override string ToString()
Some element types are represented differently than they would be in ObjectScript:
-
An empty list ("" in ObjectScript) is displayed as "$lb()".
-
Empty elements (where $lb()=$c(1)) are displayed as "null".
-
Strings are not quoted.
-
Doubles format with sixteen significant digits
Class IRISObject
Class IRISObject is a member of InterSystems.Data.IRISClient.ADO (the InterSystems ADO.NET Managed Provider). It provides methods to work with Gateway inverse proxy objects (see “Using .NET Inverse Proxy Objects” for details and examples).
IRISObject has no public constructors. Instances of IRISObject can be created by calling one of the following IRIS methods:
-
ADO.IRIS.ClassMethodObject()
-
ADO.IRIS.FunctionObject()
If the called method or function returns an object that is a valid OREF, an inverse proxy object (an instance of IRISObject) for the referenced object will be generated and returned. For example, ClassMethodObject() will return a proxy object for an object created by %New().
See “Using .NET Inverse Proxy Objects” for details and examples.
IRISObject Method Details
ADO.IRISObject.Dispose() releases this instance of IRISObject.
void Dispose()
ADO.IRISObject.Get() returns a property value of the proxy object as an instance of object.
object Get(string propertyName)
parameters:
-
propertyName — name of the property to be returned.
ADO.IRISObject.GetBool() returns a property value of the proxy object as an instance of bool.
bool GetBool(string propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.GetBytes() returns a property value of the proxy object as an instance of byte[].
byte[] GetBytes(string propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.GetDouble() returns a property value of the proxy object as an instance of double.
double GetDouble(string propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.GetIRISList() returns a property value of the proxy object as an instance of IRISList.
IRISList getIRISList(String propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.GetLong() returns a property value of the proxy object as an instance of long.
Long getLong(String propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.GetObject() returns a property value of the proxy object as an instance of object.
Object getObject(String propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.GetString() returns a property value of the proxy object as an instance of string.
String getString(String propertyName)
parameters:
-
propertyName — name of the property to be returned.
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.Invoke() invokes an instance method of the object, returning value as object.
object Invoke(string methodName, params object[] args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
Arguments may be of any of the following types: int?, short?, string, long?, double?, float?, byte[], bool?, DateTime?, IRISList?, or IRISObject. If the connection is bidirection, then any .NET object can be used as an argument.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeBool() invokes an instance method of the object, returning value as bool.
Boolean invokeBoolean(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeBytes() invokes an instance method of the object, returning value as byte[].
byte[] invokeBytes(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeDouble() invokes an instance method of the object, returning value as double.
Double invokeDouble(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeIRISList() invokes an instance method of the object, returning value as IRISList.
IRISList invokeIRISList(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeLong() invokes an instance method of the object, returning value as long.
Long invokeLong(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeObject() invokes an instance method of the object, returning value as object.
Object invokeObject(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeStatusCode() tests whether an invoke method that returns an ObjectScript $Status object would throw an error if called with the specified arguments. If the call would fail, this method throws a RuntimeException error containing the ObjectScript $Status error number and message. See “Catching %Status Error Codes” for details and examples.
void invokeStatusCode(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeString() invokes an instance method of the object, returning value as string.
String invokeString(String methodName, Object... args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
ADO.IRISObject.InvokeVoid() invokes an instance method of the object, but does not return a value.
void InvokeVoid(string methodName, params object[] args)
parameters:
-
methodName — name of the instance method to be called.
-
args — zero or more arguments of supported types.
See “IRISObject Supported Datatypes” for valid argument types and related information.
jdbc.IRISObject.iris is a public field that provides access to the instance of IRIS associated with this object.
public IRIS iris
See “IRISObject Supported Datatypes” for related information.
ADO.IRISObject.Set() sets a property of the proxy object.
void Set(string propertyName, Object value)
parameters:
-
propertyName — name of the property to which value will be assigned.
-
value — property value to assign.