Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
DocumentHistory< T > Class Template Reference

This generic class provides access to recently used documents. More...

Static Public Member Functions

static T BrowseDocuments (string documentBrowserCaption, Func< T, bool > selectionMethod=null, bool returnReference=false)
 Allows the user to select a document from a document browser showing only specific document windows.
 
static T GetLastDocument (int index=0, Func< T, bool > selectionMethod=null, bool returnReference=false)
 Returns a document which fulfills the given condition.
 
static int GetNumberOfDocuments (Func< T, bool > selectionMethod=null)
 Gets the number of documents which fulfill the given condition.
 

Detailed Description

This generic class provides access to recently used documents.

Template Parameters
TAny type derived from IDocument is supported.
Type Constraints
T :IDocument 

Member Function Documentation

◆ BrowseDocuments()

static T BrowseDocuments ( string  documentBrowserCaption,
Func< T, bool >  selectionMethod = null,
bool  returnReference = false 
)
static

Allows the user to select a document from a document browser showing only specific document windows.

Parameters
documentBrowserCaptionThe caption of the document browser.
selectionMethodOptional method to decide for any given document whether it shall be visible in the document browser (true) or not (false).
returnReferenceBy default a deep copy of the selected document is returned. However, if this optional parameter is set to true only a reference is returned.
Returns
The matching document. Null if the user closed the document browser.

◆ GetLastDocument()

static T GetLastDocument ( int  index = 0,
Func< T, bool >  selectionMethod = null,
bool  returnReference = false 
)
static

Returns a document which fulfills the given condition.

Parameters
indexBy default the most recently selected document matching the selection method is returned. But if you want e.g. the most recent but one you can set the index to 1 and so on.
selectionMethodOptional method to decide for any given document whether it shall be chosen (true) or not (false).
returnReferenceBy default a deep copy of the selected document is returned. However, if this optional parameter is set to true only a reference is returned.
Returns
The matching document.

◆ GetNumberOfDocuments()

static int GetNumberOfDocuments ( Func< T, bool >  selectionMethod = null)
static

Gets the number of documents which fulfill the given condition.

Parameters
selectionMethodOptional additional constraints that the documents must fulfill.
Returns
The number of documents which fulfill the condition.