Class for automatic unlocking project resources.
System.Object
Eplan.EplApi.DataModel.LockingStep
LockingStep must be created in every procedure which is accessing P8 in the modeless dialog box. Sample usage in the offline application
void MyModelessDialog::DoProcessing()
{
using(LockingStep oLS = new LockingStep())
{
// ... accessing P8 data ...
}
}
Dim oEplApp As EplApplication = New EplApplication
Dim strAppModifier As System.String = ""
oEplApp.Init(strAppModifier)
Dim pm As Eplan.EplApi.DataModel.ProjectManager
Dim p As Eplan.EplApi.DataModel.Project
Dim l As LockingStep
l = New LockingStep
pm = New ProjectManager
'pm.LockByDefault = true 'true by default in ProjectManager
p = pm.CreateProject("C:\\Program Files\\EPLAN\\Electric P8\\Projects\\EPLAN\\ESS_Sample_Project.elk", "C:\\Program Files\\EPLAN\\Electric P8\\Templates\\ESS\\ESS_Sample_Project.epb")
'project is locked
'Initialize()
'Processing(p)
p.Close() 'normally unlocks project
l.Dispose() 'unlocking all projects that were locked in this locking step
oEplApp.Exit()