Exemplo n.º 1
0
 public void DeleteOperations(int id)
 {
     foreach (var item in Operations)
     {
         item.Value.RemoveAll(x => x.AccountID == id);
     }
     OperationAdded?.Invoke();
 }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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;
                }
            });
        }