How do you determine if a vault is online (assume the M-Files server is online) using the functions available MFilesClientApplication.
Using the code below, M-Files puts up a dialog when in the .BintToVault function stopping code execution and the exception catch is never entered.
void BindToAll()
{
VaultConnectionsOnClient = _ClientApplication.GetVaultConnections().Cast<VaultConnection>().ToList();
foreach (VaultConnection vaultConnection in VaultConnectionsOnClient)
{
try
{
var vault = vaultConnection.BindToVault(IntPtr.Zero, CanLogIn: true, ReturnNULLIfCancelledByUser: true); // Message dialog is displayed here when vault is offline.
}
catch (Exception ex)
{
int x = 0; // Never gets here
}
}
}
This is the dialog that is displayed for each vault not online. Is there any way to suppress this and get an exception instead?
Thanks.