Ejemplo n.º 1
0
        private void GetExternalSources()
        {
            try
            {
                Task task = new TaskFactory().StartNew(async() =>
                {
                    List <ExternalSource> response = await WcmHelpers.GetDocumentImporterExternalSourcesAsync(WcmSettings);

                    _externalSourcesDictionary = response.ToDictionary(x => x.Id, x => x);
                }).ContinueWith((x) =>
                {
                    if (_externalSourcesDictionary != null)
                    {
                        foreach (var externalSource in _externalSourcesDictionary)
                        {
                            externalSource.Value.AlreadyViewedDocumentColor = ColorTranslator.FromHtml($"#{externalSource.Value.AlreadyViewedDocHexColor}");
                            externalSource.Value.NewDocumentColor           = ColorTranslator.FromHtml($"#{externalSource.Value.NewDocumentHexColor}");
                        }
                    }
                });
            }
            catch (Exception e)
            {
                Macro.Alert($"Error: {e.ToString()}");
            }
        }
Ejemplo n.º 2
0
 public override void Login(object sender, EventArgs e)
 {
     _getDocumentMapsTask = new TaskFactory().StartNew(() =>
     {
         _dataExtractionDocumentMaps =
             WcmHelpers.GetMapperDocuments(WcmConfig.DocumentMapperAiExternalSourceId, WcmConfig);
     });
 }
Ejemplo n.º 3
0
        private void ExternalSourcesComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            var waitDialog = new PleaseWaitDialog(this);

            ExternalDocumentSource selectedSource = GetExternalSourceSelected();

            waitDialog.Progress.Report($"Retrieving docs for '{selectedSource.SourceName}'...");

            List <Document> docs = WcmHelpers.GetMapperDocuments(selectedSource.Id, WcmSettings);

            _mapperDocuments = docs;
            UpdateDocsGridview(docs);
            EnableControls();

            waitDialog.PleaseWaitForm.Close();
        }