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." )> _ |
This language is not supported or no code example is available.
[Obsolete( "Use IEstimateFactory.GetEstimate(String) instead." )] |
This language is not supported or no code example is available.
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.
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.
Dim estimateFileName As String = "C:\Sample_1.qdv" |
Dim estimate As IEstimate = Nothing |
Dim tmpFileName As String = Context.QdvManager.Environment.GetQdvTempFileName( ".qdv" , "readonly_copy_" ) |
If System.IO.File.Exists(estimateFileName) Then |
System.IO.File.Copy(estimateFileName, tmpFileName, True ) |
Dim attributes As System.IO.FileAttributes = System.IO.File.GetAttributes(tmpFileName) |
attributes = attributes And Not System.IO.FileAttributes. ReadOnly |
System.IO.File.SetAttributes(tmpFileName, attributes) |
estimate = Context.QdvManager.EstimateFactory.GetEstimate(tmpFileName) |
Dim taskCount As Integer = estimate.CurrentVersion.Wbs.GetTasksForScope( "" , True ).Count |
MessageBox.Show( "The number of tasks in the inspected estimate is " & taskCount) |
If estimate IsNot Nothing Then |
This language is not supported or no code example is available.
Available since QDV 7.13.0001.
.NET Framework
Supported in: 4.8, 4.7, 4.6, 4.5.2