Exemplo n.º 1
0
        public override void Run()
        {
            var targetPath    = Arguments.First(ArgumentsDictionary.Import).Value;
            var ruleId        = Arguments.First(ArgumentsDictionary.RuleId).Value;
            var transactionId = Arguments.First(ArgumentsDictionary.ImportId).Value;

            var target = new FileSourceProfile
            {
                FilePath = targetPath,
                TransactionIdentificator = transactionId,
                RuleIdentificatorString  = ruleId
            };

            Console.WriteLine(@"Импорт из произвольного источника");
            Console.WriteLine(@"Источник: " + target.Source.Location);
            Console.WriteLine(@"Правило: " + target.Rule.Name + " (" + target.Rule.Identificator + ")");
            Console.WriteLine(@"Идентификатор: " + target.TransactionIdentificator);

            _task = ImportToolkit.CreateImportTask(target);
            _task.StageChanged    += TaskStageChanged;
            _task.ProgressChanged += TaskProgressChanged;
            _task.Interrupted     += TaskOnInterrupted;
            _task.Started         += TaskStarted;
            _task.Finished        += TaskFinished;

            _taskWaitHandle = new AutoResetEvent(false);
            _task.Start();
            //Console.WriteLine("Подготовка");

            _taskWaitHandle.WaitOne();
        }
Exemplo n.º 2
0
        public ImportProgressViewModel(IImportTask progressProxy)
        {
            _progressProxy = progressProxy;

            _progressProxy.StageChanged    += (sender, args) => Dispatcher.CurrentDispatcher.Invoke(TaskStageChanged);
            _progressProxy.ProgressChanged += (sender, args) => Dispatcher.CurrentDispatcher.Invoke(TaskProgressChanged);
            _progressProxy.Interrupted     += (sender, args) => Dispatcher.CurrentDispatcher.Invoke(TaskOnInterrupted);
            _progressProxy.Started         += (sender, args) => Dispatcher.CurrentDispatcher.Invoke(TaskStarted);
            _progressProxy.Finished        += (sender, args) => Dispatcher.CurrentDispatcher.Invoke(TaskFinished);
        }
Exemplo n.º 3
0
        public override void Run()
        {
            var sourceId = Arguments.First(ArgumentsDictionary.ImportSource).Value;
            var target   = TargetsLocator.Targets.First(t => t.TransactionIdentificator == sourceId);

            Console.WriteLine(@"Импорт источника " + target.TransactionIdentificator);
            Console.WriteLine(@"Источник: " + target.Source.Location);
            Console.WriteLine(@"Правило: " + target.Rule.Name + " (" + target.Rule.Identificator + ")");
            Console.WriteLine(@"Идентификатор: " + target.TransactionIdentificator);

            _task = ImportToolkit.CreateImportTask(target);
            _task.StageChanged    += TaskStageChanged;
            _task.ProgressChanged += TaskProgressChanged;
            _task.Interrupted     += TaskOnInterrupted;
            _task.Started         += TaskStarted;
            _task.Finished        += TaskFinished;

            _taskWaitHandle = new AutoResetEvent(false);
            _task.Start();
            Console.WriteLine("Подготовка");

            _taskWaitHandle.WaitOne();
        }
Exemplo n.º 4
0
 public ConformData(IImportTask importTask, ImportDefinitionProfile forProfile, string assetPath)
 {
     m_ImportTask     = importTask;
     m_ConformObjects = m_ImportTask.GetConformObjects(assetPath, forProfile);
 }