Skip to main content
Previous section

Native API for .NET Quick Reference

This is a quick reference for the InterSystems IRIS Native API for .NET, providing information on the following extension classes in InterSystems.Data.IRISClient.ADO:

  • Class IRIS provides the main functionality of the Native API.

  • Class IRISIterator provides methods to navigate a global array.

  • Class IRISList provides support for InterSystems $LIST serialization.

  • Class IRISObject provides methods to work with Object Gateway reverse 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.

Note:

This chapter is intended as a convenience for readers of this book, but it is not the definitive reference for the Native API. 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. Throughout the API, the subscript argument Object[] args is 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

ClassMethodBool()

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)
Copy code to clipboard

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.

ClassMethodBytes()

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)
Copy code to clipboard

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.

ClassMethodDouble()

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)
Copy code to clipboard

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.

ClassMethodIRISList()

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)
Copy code to clipboard

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.

ClassMethodLong()

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)
Copy code to clipboard

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.

ClassMethodObject()

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 a reverse proxy object (an instance of IRISObject) for the referenced object. See “Using .NET Reverse Proxy Objects” for details and examples.

object ClassMethodObject(string className, string methodName, params object[] args)
Copy code to clipboard

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.

ClassMethodStatusCode()

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)
Copy code to clipboard

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.

ClassMethodString()

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)
Copy code to clipboard

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.

ClassMethodVoid()

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)
Copy code to clipboard

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.

Close()

ADO.IRIS.Close() closes the IRIS object.

void Close()
Copy code to clipboard
CreateIRIS() [static]

ADO.IRIS.CreateIRIS() returns an instance of ADO.IRIS that uses the specified IRISConnection.

static IRIS CreateIRIS(IRISADOConnection conn)
Copy code to clipboard

parameters:

See “Introduction to Global Arrays” for more information and examples.

FunctionBool()

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)
Copy code to clipboard

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.

FunctionBytes()

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)
Copy code to clipboard

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.

FunctionDouble()

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)
Copy code to clipboard

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.

FunctionInt()

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)
Copy code to clipboard

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.

FunctionIRISList()

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)
Copy code to clipboard

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.

FunctionLong()

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)
Copy code to clipboard

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.

FunctionObject()

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 a reverse proxy object (an instance of IRISObject) for the referenced object. See “Using .NET Reverse Proxy Objects” for details and examples.

object FunctionObject(string functionName, string routineName, params object[] args)
Copy code to clipboard

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.

FunctionString()

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)
Copy code to clipboard

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.

GetAPIVersion() [static]

ADO.IRIS.GetAPIVersion() returns the IRIS Native API version string.

static String GetAPIVersion()
Copy code to clipboard
GetBool()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetBytes()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetDateTime()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetDouble()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetInt16()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetInt32()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetInt64()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetIRISIterator()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetIRISList()

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)
Copy code to clipboard

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.

GetIRISReverseIterator()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetObject()

ADO.IRIS.GetObject() gets the value of the global as an Object (or null if node does not exist). See “Using .NET Reverse Proxy Objects” for details and examples.

object GetObject(string globalName, params object[] subscripts)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetServerVersion()

ADO.IRIS.GetServerVersion() returns the server version string for the current connection. This is equivalent to calling $system.Version.GetVersion() in ObjectScript.

String GetServerVersion()
Copy code to clipboard
GetSingle()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetString()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

See “Class IRIS Supported Datatypes” for related information.

GetTLevel()

ADO.IRIS.GetTLevel() gets the level of the current nested IRIS Native 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()
Copy code to clipboard

This method uses the IRIS Native 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.

Increment()

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)
Copy code to clipboard

parameters:

  • valuelong 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.

IsDefined()

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)
Copy code to clipboard

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

Kill()

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)
Copy code to clipboard

parameters:

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

Lock()

ADO.IRIS.Lock() locks the global for an IRIS Native 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)
Copy code to clipboard

parameters:

  • lockMode — Character S for shared Lock, E for escalating Lock, or SE for both. Default is empty string (exclusive and non-escalating).

  • timeout — amount to wait to acquire the Lock in seconds.

  • globalName — global name.

  • subscripts — zero or more subscripts specifying the target node.

This method uses the IRIS Native 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.

Procedure()

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)
Copy code to clipboard

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.

ReleaseAllLocks()

ADO.IRIS.ReleaseAllLocks() is an IRIS Native transaction method that releases all locks associated with the session.

void ReleaseAllLocks()
Copy code to clipboard

This method uses the IRIS Native 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.

Set()

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)
Copy code to clipboard

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.

Notes on specific datatypes

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.

TCommit()

ADO.IRIS.TCommit() commits the current IRIS Native transaction.

void TCommit()
Copy code to clipboard

This method uses the IRIS Native 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.

TRollback()

ADO.IRIS.TRollback() rolls back all open IRIS Native transactions in the session.

void TRollback()
Copy code to clipboard

This method uses the IRIS Native 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.

TRollbackOne()

ADO.IRIS.TRollbackOne() rolls back the current level IRIS Native transaction only. If this is a nested transaction, any higher-level transactions will not be rolled back.

void TRollbackOne()
Copy code to clipboard

This method uses the IRIS Native 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.

TStart()

ADO.IRIS.TStart() starts/opens an IRIS Native transaction.

void TStart()
Copy code to clipboard

This method uses the IRIS Native 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.

Unlock()

ADO.IRIS.Unlock() unlocks the global in an IRIS Native 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)
Copy code to clipboard

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 IRIS Native 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:

See “Iterating Over a Set of Child Nodes” for more information and examples.

This class implements required IEnumerator method System.Collections.IEnumerator.GetEnumerator(), 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

Property Current

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]
Copy code to clipboard
Property CurrentSubscript

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]
Copy code to clipboard
MoveNext()

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()
Copy code to clipboard
Reset()

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()
Copy code to clipboard
StartFrom()

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)
Copy code to clipboard

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)
Copy code to clipboard

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:

Create an empty IRISList
IRISList list = new IRISList();
Copy code to clipboard
Create a copy of another IRISList

Create a copy of the IRISList instance specified by argument list.

IRISList listcopy = new IRISList(myOtherList)
Copy code to clipboard
Construct an IRISList instance from a byte array

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);
Copy code to clipboard

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

Add()

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)
Copy code to clipboard

parameters:

Adding an IRISList element

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.

AddRange()

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)
Copy code to clipboard

parameters:

See “Class IRIS Supported Datatypes” for related information.

Clear()

ADO.IRISList.Clear() resets the list by removing all elements from the list.

void Clear()
Copy code to clipboard
Count()

ADO.IRISList.Count() iterates over the list and returns the number of elements encountered.

int Count()
Copy code to clipboard
DateToHorolog() [static]

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)
Copy code to clipboard

parameters:

DateToPosix() [static]

ADO.IRISList.DateToPosix() converts a Time object to the time field of a $Horolog string.

static long DateToPosix(DateTime Value)
Copy code to clipboard

parameters:

Equals()

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)
Copy code to clipboard

parameters:

  • list — instance of IRISList to compare.

Get()

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)
Copy code to clipboard

parameters:

  • index — integer specifying the list element to be retrieved.

GetList()

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)
Copy code to clipboard

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.

HorologToDate() [static]

ADO.IRISList.HorologToDate() converts the day field of a $Horolog string to a DateTime value. Also see DateToHorolog().

static DateTime HorologToDate(int HorologValue)
Copy code to clipboard

parameters:

  • HorologValueint representing the day field of a $Horolog string.

HorologToTime() [static]

ADO.IRISList.HorologToTime() converts the time field of a $Horolog string to a TimeSpan value. Also see TimeToHorolog().

static TimeSpan HorologToTime(int HorologValue)
Copy code to clipboard

parameters:

  • HorologValueint 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.

PosixToDate() [static]

ADO.IRISList.PosixToDate() converts a %Library.PosixTime value to a DateTime. Also see DateToPosix().

static DateTime PosixToDate(long PosixValue)
Copy code to clipboard

parameters:

  • PosixValue — the %PosixTime value (a 64-bit signed integer).

Remove()

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)
Copy code to clipboard

parameters:

  • index — integer specifying the list element to remove.

Set()

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)
Copy code to clipboard

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

  • valueObject value or object[] array to insert at index

Size()

ADO.IRISList.Size() returns the byte length of the serialized value for this IRISList.

int Size()
Copy code to clipboard
SubList()

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)
Copy code to clipboard

parameters:

  • from — index of first element to add to the new list.

  • to — index of last element to add to the new list.

TimeToHorolog() [static]

ADO.IRISList.TimeToHorolog() converts a DateTime value to the time field of a $Horolog value. Also see HorologToTime().

static int TimeToHorolog(DateTime value)
Copy code to clipboard

parameters:

ToArray()

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()
Copy code to clipboard
ToList()

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()
Copy code to clipboard
ToString()

ADO.IRISList.ToString() returns a printable representation of the list.

override string ToString()
Copy code to clipboard

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 Object Gateway reverse proxy objects (see “Using .NET Reverse 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:

If the called method or function returns an object that is a valid OREF, a reverse 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 Reverse Proxy Objects” for details and examples.

IRISObject Method Details

Dispose()

ADO.IRISObject.Dispose() releases this instance of IRISObject.

void Dispose()
Copy code to clipboard
Get()

ADO.IRISObject.Get() returns a property value of the proxy object as an instance of object.

object Get(string propertyName)
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

GetBool()

ADO.IRISObject.GetBool() returns a property value of the proxy object as an instance of bool.

bool GetBool(string propertyName)
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

GetBytes()

ADO.IRISObject.GetBytes() returns a property value of the proxy object as an instance of byte[].

byte[] GetBytes(string propertyName) 
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

GetDouble()

ADO.IRISObject.GetDouble() returns a property value of the proxy object as an instance of double.

double GetDouble(string propertyName) 
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

GetIRISList()

ADO.IRISObject.GetIRISList() returns a property value of the proxy object as an instance of IRISList.

IRISList  getIRISList(String propertyName)
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

GetLong()

ADO.IRISObject.GetLong() returns a property value of the proxy object as an instance of long.

Long  getLong(String propertyName)
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

GetObject()

ADO.IRISObject.GetObject() returns a property value of the proxy object as an instance of object.

Object  getObject(String propertyName)
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

GetString()

ADO.IRISObject.GetString() returns a property value of the proxy object as an instance of string.

String  getString(String propertyName)
Copy code to clipboard

parameters:

  • propertyName — name of the property to be returned.

See “IRISObject Supported Datatypes” for related information.

Invoke()

ADO.IRISObject.Invoke() invokes an instance method of the object, returning value as object.

object Invoke(string methodName, params object[] args)
Copy code to clipboard

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.

InvokeBoolean()

ADO.IRISObject.InvokeBool() invokes an instance method of the object, returning value as bool.

Boolean  invokeBoolean(String methodName, Object... args)
Copy code to clipboard

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.

InvokeBytes()

ADO.IRISObject.InvokeBytes() invokes an instance method of the object, returning value as byte[].

byte[]  invokeBytes(String methodName, Object... args)
Copy code to clipboard

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.

InvokeDouble()

ADO.IRISObject.InvokeDouble() invokes an instance method of the object, returning value as double.

Double  invokeDouble(String methodName, Object... args)
Copy code to clipboard

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.

InvokeIRISList()

ADO.IRISObject.InvokeIRISList() invokes an instance method of the object, returning value as IRISList.

IRISList  invokeIRISList(String methodName, Object... args)
Copy code to clipboard

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.

InvokeLong()

ADO.IRISObject.InvokeLong() invokes an instance method of the object, returning value as long.

Long  invokeLong(String methodName, Object... args)
Copy code to clipboard

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.

InvokeObject()

ADO.IRISObject.InvokeObject() invokes an instance method of the object, returning value as object.

Object  invokeObject(String methodName, Object... args)
Copy code to clipboard

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.

InvokeStatusCode()

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)
Copy code to clipboard

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.

InvokeString()

ADO.IRISObject.InvokeString() invokes an instance method of the object, returning value as string.

String  invokeString(String methodName, Object... args)
Copy code to clipboard

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.

InvokeVoid()

ADO.IRISObject.InvokeVoid() invokes an instance method of the object, but does not return a value.

void InvokeVoid(string methodName, params object[] args)
Copy code to clipboard

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.

iris [attribute]

jdbc.IRISObject.iris is a public field that provides access to the instance of IRIS associated with this object.

public IRIS iris
Copy code to clipboard

See “IRISObject Supported Datatypes” for related information.

Set()

ADO.IRISObject.Set() sets a property of the proxy object.

void Set(string propertyName, Object value)
Copy code to clipboard

parameters:

  • propertyName — name of the property to which value will be assigned.

  • value — property value to assign.