private void SubscribeForEvents() { ptrBackupEvent = new InternalCAPI.ServerBackupCallback(BackupFunction); ptrCleanupEvent = new InternalCAPI.ServerCleanupCallback(CleanupFunction); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.SubscribeForBackupEvents(ptrBackupEvent)); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.SubscribeForCleanupEvents(ptrCleanupEvent)); }
public static void RaiseIfNotSucceeded(int result) { if (result != 0) { CeBackupServerException ex = new CeBackupServerException(GetError(result)); ex.StackTrace = Environment.StackTrace; Logger.Error(ex.ToString() + "\nStackTrace: " + ex.StackTrace); throw ex; } }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Restore_Uninit()); disposed = true; }
public string[] Restore_ListAll() { uint count = 0; UnmarshaledString UnmanagedStringArray = IntPtr.Zero; CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Restore_ListAll(out UnmanagedStringArray, out count)); string[] ManagedStringArray = null; MarshalUnmananagedStrArray2ManagedStrArray(UnmanagedStringArray, (int)count, out ManagedStringArray); return(ManagedStringArray); }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } UnsubscribeFromEvents(); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Uninit()); disposed = true; _instance = null; }
public void ReloadConfig(string IniPath) { CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.ReloadConfig(IniPath)); }
private void UnsubscribeFromEvents() { CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.UnsubscribeFromBackupEvents()); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.UnsubscribeFromCleanupEvents()); }
public void Stop() { UnsubscribeFromEvents(); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Stop()); }
public void Start(string IniPath) { SubscribeForEvents(); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Start(IniPath)); }
private CeBackupServerManager() { CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Init()); }
public void RestoreTo(string BackupPath, string DirTo) { CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Restore_RestoreTo(BackupPath, DirTo)); }
public void Restore(string BackupPath) { CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Restore_Restore(BackupPath)); }
public void Init(string IniPath) { _IniPath = IniPath; CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Restore_Init(_IniPath)); }