Show / Hide Table of Contents

Class AsyncProviderWrapper

Wrapper class to run Archive Providers asynchronously; read remarks on GetRows(String) for special processing information

Inheritance
Object
AsyncProviderWrapper
Implements
IArchiveProvider
IArchiveProviderHasRows
IArchiveProviderHasColumns
IArchiveProviderHasEntities
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.ArchiveLists
Assembly: SoDataBase.dll
Syntax
public class AsyncProviderWrapper : IArchiveProvider, IArchiveProviderHasRows, IArchiveProviderHasColumns, IArchiveProviderHasEntities, IPlugin
Remarks

Clients that perform heavy (GUI?) processing on archive rows may consider using this wrapper (constructed by the CreateAsyncWrapped(String, String) factory method). By doing so, the actual calls to GetRows - which can be time-consuming, especially the first one - will be run in an asynchronous manner

Constructors

AsyncProviderWrapper(IArchiveProvider)

Declaration
public AsyncProviderWrapper(IArchiveProvider innerProvider)
Parameters
Type Name Description
IArchiveProvider innerProvider

Methods

Close()

Close the archive provider; can be called at any time and will return immediately

Declaration
public void Close()

GetAvailableColumns()

Declaration
public List<ArchiveColumnInfo> GetAvailableColumns()
Returns
Type Description
List<ArchiveColumnInfo>

GetAvailableEntities()

Declaration
public List<ArchiveRowTypeInfo> GetAvailableEntities()
Returns
Type Description
List<ArchiveRowTypeInfo>

GetReader(String)

Start the provider, returning an IDataReader compatible object to the client for row enumeration and data access

Declaration
public virtual IDataReader GetReader(string options)
Parameters
Type Name Description
String options

Options, passed to the internal GetRows method

Returns
Type Description
IDataReader

IDataReader primed to provide results

GetResultInformation()

Declaration
public ArchiveResultInformation GetResultInformation()
Returns
Type Description
ArchiveResultInformation

GetRows(String)

Get rows, asynchronously. This method may return null rows while waiting for "real" data; the client must handle this

Declaration
public IEnumerable<ArchiveRow> GetRows(string options)
Parameters
Type Name Description
String options
Returns
Type Description
IEnumerable<ArchiveRow>
Remarks

The inner provider's GetRows is run in a loop in another thread. This method will pick results from a queue, using a blocking semaphore to do so efficiently. While waiting for a result to become available, there is a timeout of 50ms; if no data are forthcoming then a null row is returned.

The client should react to this dummy row by letting the GUI/command/message loop run; and then call the GetRows().MoveNext iterator again (or just keep going in a foreach loop). It is legal to call Close() if the user decides to cancel/not wait for the results.

SetDesiredColumns(String[])

Declaration
public void SetDesiredColumns(params string[] columnIds)
Parameters
Type Name Description
String[] columnIds

SetDesiredEntities(String[])

Declaration
public void SetDesiredEntities(params string[] entities)
Parameters
Type Name Description
String[] entities

SetOrderBy(ArchiveOrderByInfo[])

Declaration
public void SetOrderBy(params ArchiveOrderByInfo[] orderBy)
Parameters
Type Name Description
ArchiveOrderByInfo[] orderBy

SetPagingInfo(Int32, Int32)

Declaration
public void SetPagingInfo(int pageSize, int pageNumber)
Parameters
Type Name Description
Int32 pageSize
Int32 pageNumber

SetRestriction(ArchiveRestrictionInfo[])

Declaration
public bool SetRestriction(params ArchiveRestrictionInfo[] restrictions)
Parameters
Type Name Description
ArchiveRestrictionInfo[] restrictions
Returns
Type Description
Boolean

Implements

IArchiveProvider
IArchiveProviderHasRows
IArchiveProviderHasColumns
IArchiveProviderHasEntities

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top