Пример #1
0
        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);
        }
Пример #4
0
        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);
        }
Пример #6
0
 public bool IsBackupStarted()
 {
     return(InternalCAPI.IsBackupStarted() > 0);
 }
Пример #7
0
 public bool IsDriverStarted()
 {
     return(InternalCAPI.IsDriverStarted() > 0);
 }
Пример #8
0
 public void ReloadConfig(string IniPath)
 {
     CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.ReloadConfig(IniPath));
 }
Пример #9
0
 private void UnsubscribeFromEvents()
 {
     CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.UnsubscribeFromBackupEvents());
     CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.UnsubscribeFromCleanupEvents());
 }
Пример #10
0
 public void Stop()
 {
     UnsubscribeFromEvents();
     CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Stop());
 }
Пример #11
0
 public void Start(string IniPath)
 {
     SubscribeForEvents();
     CeBackupServerException.RaiseIfNotSucceeded(InternalCAPI.Start(IniPath));
 }
Пример #12
0
 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));
 }