Beispiel #1
0
 private void BackupFunction(string SrcPath, string DstPath, int Deleted, System.IntPtr Pid)
 {
     try
     {
         BackupEvent?.Invoke(SrcPath, DstPath, Deleted, Pid);
     }
     catch {}
 }
Beispiel #2
0
 public void OnBackup(string SrcPath, string DstPath, int Deleted, System.IntPtr Pid)
 {
     try
     {
         BackupEvent?.Invoke(SrcPath, DstPath, Deleted, Pid);
     }
     catch (Exception ex)
     {
         throw ErrorHandling.Proceed(ex);
     }
 }
        private void AddEvent(BackupEvent notification, string description)
        {
            DataTable _table = null;

            try { _table = (DataTable)grdStatus.DataSource; }
            catch { _table = null; }

            if (_table != null)
            {
                object[]             _values = new object[_table.Columns.Count];
                DataColumnCollection _cols   = _table.Columns;

                Image _image = null;

                switch (notification)
                {
                case BackupEvent.Error:
                    _image = _eventimages.Images["error"];  break;

                case BackupEvent.Information:
                    _image = _eventimages.Images["information"];  break;

                case BackupEvent.Success:
                    _image = _eventimages.Images["good"];  break;

                case BackupEvent.Warning:
                    _image = _eventimages.Images["exclamation"];  break;

                default: break;
                }

                _values[_cols["Image"].Ordinal] = _image;
                _values[_cols["Event"].Ordinal] = description;
                _table.Rows.Add(_values);
            }
        }
 public static void HandleBackupRequest()
 {
     LoggingService.LogInfo("Received model backup requested");
     BackupEvent.Raise();
     LoggingService.LogInfo("Attempting to backup model");
 }