private void SubscribeForEvents() { ptrBackupEvent = new InternalCAPI.ServerBackupCallback(BackupFunction); ptrCleanupEvent = new InternalCAPI.ServerCleanupCallback(CleanupFunction); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.SubscribeForBackupEvents(ptrBackupEvent)); CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.SubscribeForCleanupEvents(ptrCleanupEvent)); }
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; }
internal static string GetDescription(Enum en) { Type type = en.GetType(); MemberInfo[] memInfo = type.GetMember(en.ToString()); if (memInfo != null && memInfo.Length > 0) { object[] attrs = memInfo[0].GetCustomAttributes(typeof(DescriptionAttribute), false); if (attrs != null && attrs.Length > 0) { return(((System.ComponentModel.DescriptionAttribute)attrs[0]).Description); } } UnmarshaledString ptr = (UnmarshaledString)InternalCAPI.GetLastErrorString(); string strLastError = Marshal.PtrToStringAuto(ptr); Marshal.FreeCoTaskMem(ptr); return(en.ToString() + " - \r\n" + strLastError); }
public bool IsBackupStarted() { return(InternalCAPI.IsBackupStarted() > 0); }
public bool IsDriverStarted() { return(InternalCAPI.IsDriverStarted() > 0); }
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)); }