IEstimateFactory.GetEstimate (String, Boolean) Method

NOTE: This member is now obsolete. Use IEstimateFactory.GetEstimate(String) instead.

Creates the IEstimate instance from specified estimate file.
[Obsolete("Use IEstimateFactory.GetEstimate(String) instead.")] 
IEstimate GetEstimate( 
   string file
   bool forReadOnly 
)

Parameters

file
string

The full path to the estimate .qdv file.

forReadOnly
bool

Unused, it has no effect. See Remarks.

Return Value

IEstimate

The estimate loaded from the file.

Remarks
 

The estimate is opened for Admin.

The estimate is only opened if it's not in use. It is the responsibility of the caller to handle a situation when the estimate file is already opened. If you want to safely open the estimate just for read-only purposes even if the estimate was already opened, create a tmp copy of the original file and open that copy. You can use IQdvEnvironment.GetQdvTempFileName method to obtain such a file path.

Example
 

The following example opens an estimate from a temporary copy of an estimate file. This will prevent from any accidental changes in the original file and more importantly, it prevents problems if the estimate is already opened (and thus locked). When everything is finished, the estimate is closed. 

This language is not supported or no code example is available.
Version
 
Available since QDV 7.13.0001.

.NET Framework

Supported in: 4.8, 4.7, 4.6, 4.5.2