AdgFactory class | QSYS API Reference Guide

Estimated reading time: 14 minutes

The AdgFactory class static methods construct instances of IAdgObject representing database files, libraries, and members along with IDataArea for data areas.

Namespace: ASNA.DataGate.Client Assembly: ASNA.QSys.DataGate.Client.dll

Inheritance: Object

Thread Safety

Any public static (Shared) members of this type are safe for multithreaded operations.

Any instance members are not guaranteed to be thread safe.

Properties

Type Name Description
Int32 AppDefaultBulkCopyTimeout Gets or sets the default timeout for bulk copy operations.
Boolean AppUseBulkCopyByDefault Gets or sets a value indicating whether the application should use bulk copy by default.

Methods

Signature Description
NewDataArea(AdgConnection, String) Creates a new instance of the interface with an unknown subtype.
NewDataArea(AdgConnection, String, AdgSubTypes) Creates a new instance of the interface with a specified subtype.
NewDirectory(AdgConnection, String) Creates a new instance of the interface.
NewFile(AdgConnection, String) Creates a new instance of the interface.
NewLibraryList(AdgConnection) Creates a new instance of the interface.
NewMember(AdgConnection, String) Creates a new instance of the interface.
NewObject(AdgConnection, AdgObjectTypes, String) Creates a new instance of the interface.
NewSystemValue(AdgConnection, Boolean) Creates a new instance of the interface.
ReadXml(AdgConnection, String, AdgObjectTypes, String, XmlReader, XmlOptions, XmlCancelEventHandler) Reads an XML document and creates a new instance of the interface.
ReadXml(AdgConnection, String, AdgObjectTypes, String, XmlReader, XmlOptions) Reads an XML document and creates a new instance of the interface.
ReadXml(AdgConnection, String, AdgObjectTypes, XmlReader, XmlOptions, XmlCancelEventHandler) Reads an XML document and creates a new instance of the interface.
ReadXml(AdgConnection, String, AdgObjectTypes, XmlReader, XmlOptions) Reads an XML document and creates a new instance of the interface.
Synchronized(IAdgObject) Wraps an in a synchronized (thread-safe) wrapper.
Synchronized(ILibraryList) Wraps an in a synchronized (thread-safe) wrapper.

IDataArea NewDataArea(AdgConnection cn, string PathName)

Creates a new instance of the interface with an unknown subtype.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.The subtype of the data area is set to .

IDataArea NewDataArea(AdgConnection cn, string PathName)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String PathName The path name of the data area.

Returns

Type Description
IDataArea A new instance of the interface.

IDataArea NewDataArea(AdgConnection cn, string PathName, AdgSubTypes DataAreaType)

Creates a new instance of the interface with a specified subtype.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.The subtype of the data area is set to the value of the parameter.

IDataArea NewDataArea(AdgConnection cn, string PathName, AdgSubTypes DataAreaType)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String PathName The path name of the data area.
AdgSubTypes DataAreaType The subtype of the data area.

Returns

Type Description
IDataArea A new instance of the interface.

IDirectory NewDirectory(AdgConnection cn, string PathName)

Creates a new instance of the interface.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.

IDirectory NewDirectory(AdgConnection cn, string PathName)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String PathName The path name of the directory.

Returns

Type Description
IDirectory A new instance of the interface.

IFileObject NewFile(AdgConnection cn, string PathName)

Creates a new instance of the interface.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.

IFileObject NewFile(AdgConnection cn, string PathName)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String PathName The path name of the file.

Returns

Type Description
IFileObject A new instance of the interface.

ILibraryList NewLibraryList(AdgConnection cn)

Creates a new instance of the interface.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.

ILibraryList NewLibraryList(AdgConnection cn)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.

Returns

Type Description
ILibraryList A new instance of the interface.

IMember NewMember(AdgConnection cn, string PathName)

Creates a new instance of the interface.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.

IMember NewMember(AdgConnection cn, string PathName)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String PathName The path name of the member.

Returns

Type Description
IMember A new instance of the interface.

IAdgObject NewObject(AdgConnection cn, AdgObjectTypes type, string path)

Creates a new instance of the interface.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.

IAdgObject NewObject(AdgConnection cn, AdgObjectTypes type, string path)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
AdgObjectTypes type The type of the object to create.
String path The path of the object to create.

Returns

Type Description
IAdgObject A new instance of the interface.

ISystemValue NewSystemValue(AdgConnection cn, bool withNewTransaction)

Creates a new instance of the interface.

Remarks

This method uses the method to create a new instance of the interface.The method is a generic method that takes a function delegate as a parameter.The function delegate is responsible for creating the new instance.If the parameter is null, an is thrown.

ISystemValue NewSystemValue(AdgConnection cn, bool withNewTransaction)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
Boolean withNewTransaction A boolean value indicating whether to create a new transaction.

Returns

Type Description
ISystemValue A new instance of the interface.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, string docObjectNewName, XmlReader reader, XmlOptions options, XmlCancelEventHandler observer)

Reads an XML document and creates a new instance of the interface.

Remarks

This method uses the method to read an XML document and create a new instance of the interface.The method takes several parameters, including an , a container path, an object type, a new object name, an , an , and an .If the parameter is null, an is thrown.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, string docObjectNewName, XmlReader reader, XmlOptions options, XmlCancelEventHandler observer)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String containerPath The path of the container for the object.
AdgObjectTypes docObjectType The type of the object to create.
String docObjectNewName The new name for the object, or null to use the existing name.
XmlReader reader The to use to read the XML document.
XmlOptions options The to use when reading the XML document.
XmlCancelEventHandler observer An optional to observe the reading process.

Returns

Type Description
IAdgObject A new instance of the interface.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, string docObjectNewName, XmlReader reader, XmlOptions options)

Reads an XML document and creates a new instance of the interface.

Remarks

This method is a convenience overload of the ReadXml method that does not require an parameter.It calls the ReadXml method with the provided parameters and a null .If the parameter is null, an is thrown.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, string docObjectNewName, XmlReader reader, XmlOptions options)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String containerPath The path of the container for the object.
AdgObjectTypes docObjectType The type of the object to create.
String docObjectNewName The new name for the object.
XmlReader reader The to use to read the XML document.
XmlOptions options The to use when reading the XML document.

Returns

Type Description
IAdgObject A new instance of the interface.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, XmlReader reader, XmlOptions options, XmlCancelEventHandler observer)

Reads an XML document and creates a new instance of the interface.

Remarks

This method is a convenience overload of the ReadXml method that does not require a new object name parameter.It calls the ReadXml method with the provided parameters and a null new object name.If the parameter is null, an is thrown.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, XmlReader reader, XmlOptions options, XmlCancelEventHandler observer)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String containerPath The path of the container for the object.
AdgObjectTypes docObjectType The type of the object to create.
XmlReader reader The to use to read the XML document.
XmlOptions options The to use when reading the XML document.
XmlCancelEventHandler observer An optional to observe the reading process.

Returns

Type Description
IAdgObject A new instance of the interface.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, XmlReader reader, XmlOptions options)

Reads an XML document and creates a new instance of the interface.

Remarks

This method is a convenience overload of the ReadXml method that does not require a new object name or an parameter.It calls the ReadXml method with the provided parameters, a null new object name, and a null .If the parameter is null, an is thrown.

IAdgObject ReadXml(AdgConnection cn, string containerPath, AdgObjectTypes docObjectType, XmlReader reader, XmlOptions options)

Parameters

Type Parameter name Description
AdgConnection cn The to use for the operation.
String containerPath The path of the container for the object.
AdgObjectTypes docObjectType The type of the object to create.
XmlReader reader The to use to read the XML document.
XmlOptions options The to use when reading the XML document.

Returns

Type Description
IAdgObject A new instance of the interface.

IAdgObject Synchronized(IAdgObject adgObj)

Wraps an in a synchronized (thread-safe) wrapper.

Remarks

This method checks the type of the parameter and wraps it in a corresponding synchronized (thread-safe) wrapper.If the object is already a synchronized object, it is returned as is.If the object is an , it is wrapped in a .If the object is an , it is wrapped in a .If the object is an , it is wrapped in a .If the object is an , it is wrapped in a .If the object is none of the above types, it is wrapped in a .

IAdgObject Synchronized(IAdgObject adgObj)

Parameters

Type Parameter name Description
IAdgObject adgObj The to wrap.

Returns

Type Description
IAdgObject A thread-safe wrapper around the .

ILibraryList Synchronized(ILibraryList llObj)

Wraps an in a synchronized (thread-safe) wrapper.

Remarks

This method checks if the parameter is already a synchronized object. If it is, the method returns the object as is. If it’s not, the method wraps it in a to ensure thread safety.

ILibraryList Synchronized(ILibraryList llObj)

Parameters

Type Parameter name Description
ILibraryList llObj The to wrap.

Returns

Type Description
ILibraryList A thread-safe wrapper around the .