public void DeleteOperations(int id) { foreach (var item in Operations) { item.Value.RemoveAll(x => x.AccountID == id); } OperationAdded?.Invoke(); }
public void AddOperation(DateTime date, MoneyOperation operation) { if (Operations.ContainsKey(date)) { Operations[date].Add(operation); } else { Operations.Add(date, new List <MoneyOperation> { operation }); } OperationAdded?.Invoke(); }
private void _queue(FileOperationBase operation) { operation.ScheduledTime = DateTime.UtcNow; operation.OperationStatus = FileOperationStatus.Waiting; Logger.Info("Operation scheduled: {0}", operation); switch (operation) { case IngestOperation _: _queueConvertOperation.Enqueue(operation); break; case ExportOperation _: _queueExportOperation.Enqueue(operation); break; case CopyOperation _: case DeleteOperation _: case LoudnessOperation _: case MoveOperation _: _queueSimpleOperation.Enqueue(operation); break; } OperationAdded?.Invoke(this, new FileOperationEventArgs(operation)); }
private async void _queue(FileOperation operation) { await Task.Run(() => { operation.ScheduledTime = DateTime.UtcNow; operation.OperationStatus = FileOperationStatus.Waiting; Logger.Info("Operation scheduled: {0}", operation); OperationAdded?.Invoke(this, new FileOperationEventArgs(operation)); if (operation.Kind == TFileOperationKind.Copy || operation.Kind == TFileOperationKind.Move || operation.Kind == TFileOperationKind.Ingest) { IMedia destMedia = operation.Dest; if (destMedia != null) { destMedia.MediaStatus = TMediaStatus.CopyPending; } } switch (operation.Kind) { case TFileOperationKind.Ingest: _queueConvertOperation.Enqueue(operation); break; case TFileOperationKind.Export: _queueExportOperation.Enqueue(operation); break; case TFileOperationKind.Copy: case TFileOperationKind.Delete: case TFileOperationKind.Loudness: case TFileOperationKind.Move: _queueSimpleOperation.Enqueue(operation); break; } }); }