public void ConnectToLibrary( BaseLibraryConnection connection, string password, bool rememberPassword )
Parameters
- connection
- Connection to the library.
- password
- Password.
- rememberPassword
- Remember the password?
public void ConnectToLibrary( BaseLibraryConnection connection, string password, bool rememberPassword )
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.HpdApiNotInitializedException | Api is not in an initialized state. You can get current state from Status property. If API is uninitialized, you can initialize it by calling Init(String,String[]) method. If API is in failed state, you can not resurrect it. |
EPLAN.Harness.API.Exceptions.FileNotFoundException | This file was not found. |
EPLAN.Harness.API.Exceptions.FileExtensionException | The exception that is thrown when the file has the wrong extension. |
EPLAN.Harness.API.Exceptions.ArgumentException | Argument is invalid. The exception is thrown when a wrong argument is passed to the method or the setter of property. |
EPLAN.Harness.API.Exceptions.ArgumentNullException | Argument is null. |
EPLAN.Harness.API.Exceptions.SecurityException | The exception that is thrown when there is a problem with security. |
EPLAN.Harness.API.Exceptions.LibraryVersionException | The exception that is thrown when the library has the wrong version. |
EPLAN.Harness.API.Exceptions.ConnectionException | The exception that is thrown when there is a problem with the connection of an occurrence. |
Fill password in case you are connecting to a library which is protected by a password and the password is not saved in the connection. Set rememberPassword to 'True' if you want to save the password to the connection.
Connected library is available through CurrentLibrary.
Library library = Library.GetInstance();
// Create new connection or get any recent connection.
BaseLibraryConnection connection = ...
library.ConnectToLibrary(connection);
Library library = Library.GetInstance(); // Create new connection or get any recent connection. BaseLibraryConnection connection = ... // The password will be remembered for next time. library.ConnectToLibrary(connection, "password", true);