Beispiel #1
0
        private void MoveToArchive(TransmittalVM trans)
        {
            var file = trans.File;

            file.MoveTo(ArchivePath(file));

            _ui.Send(x => Archive.Add(file.Name), null);
            if (Archive.Count > MAX_ARCHIVE)
            {
                _ui.Send(x => Archive.RemoveAt(0), null);
            }

            //OnGoing.Remove(trans);
            _ui.Send(x => OnGoing.Remove(trans), null);
            //Pending.Remove(file);
            _ui.Send(x => Pending.Remove(file), null);
        }
Beispiel #2
0
        private async void Pending_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action != NotifyCollectionChangedAction.Add)
            {
                return;
            }

            foreach (FileInfo file in e.NewItems)
            {
                while (IsCurrentMinute(file))
                {
                    await Task.Delay(1000 * 15);
                }

                var trans = new TransmittalVM();
                _ui.Send(x => OnGoing.Add(trans), null);
                trans.Completed += (s, a) => MoveToArchive(trans);
                trans.Send(Target.Title, file);
            }
        }
Beispiel #3
0
        private async void Pending_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
        {
            if (e.Action != NotifyCollectionChangedAction.Add) return;

            foreach (FileInfo file in e.NewItems)
            {
                while (IsCurrentMinute(file))
                    await Task.Delay(1000 * 15);

                var trans = new TransmittalVM();
                _ui.Send(x => OnGoing.Add(trans), null);
                trans.Completed += (s, a) => MoveToArchive(trans);
                trans.Send(Target.Title, file);
            }
        }
Beispiel #4
0
        private void MoveToArchive(TransmittalVM trans)
        {
            var file  = trans.File;
            file.MoveTo(ArchivePath(file));

            _ui.Send(x => Archive.Add(file.Name), null);
            if (Archive.Count > MAX_ARCHIVE)
                _ui.Send(x => Archive.RemoveAt(0), null);

            //OnGoing.Remove(trans);
            _ui.Send(x => OnGoing.Remove(trans), null);
            //Pending.Remove(file);
            _ui.Send(x => Pending.Remove(file), null);
        }