Eplan Platform API
Eplan.EplApi.DataModel Namespace / Project Class / LockAllObjects Method
Example

In This Topic
    LockAllObjects Method (Project)
    In This Topic
    Locks all data model objects in the project.
    Syntax
    public void LockAllObjects()
    public:
    void LockAllObjects(); 
    Exceptions
    ExceptionDescription
    Thrown when the project cannot be locked.
    Remarks
    Result is the same as when getting a project from a ProjectManager object with the ProjectManager.LockProjectByDefault property set to TRUE (i.e. all project's objects are locked for an exclusive write and cannot be modified by other users).
    Example
    using (LockingStep ls = new LockingStep())
    {
     try
     {
     	_prj.LockAllObjects();
     	// all project's objects are locked now
     }
     catch (ProjectLockingException ex)
     {
     	// the whole project couldn't be locked
     }
    }
    // here, when the LockingStep object is disposed, the project is unlocked again
    See Also