private void StartExport()
        {
            _isCancelled = false;

            // save the file off in prefs for later...
            Config.SetUser(User, "XMLIOExport.LastExportFile", txtFilename.Text);

            if (string.IsNullOrEmpty(txtFilename.Text))
            {
                ErrorMessage.Show("You must select a destination file before you can continue");
                return;
            }

            btnStart.IsEnabled  = false;
            btnCancel.IsEnabled = true;

            var options = new XMLIOExportOptions {
                Filename = this.Filename, ExportChildTaxa = this.ExportChildTaxa, ExportMaterial = this.ExportMaterial, ExportTraits = this.ExportNotes, ExportMultimedia = this.ExportMultimedia, ExportNotes = this.ExportNotes, IncludeFullClassification = this.IncludeFullClassification, KeepLogFile = this.KeepLogFile
            };

            var service = new XMLIOService(User);

            JobExecutor.QueueJob(() => {
                service.ExportXML(TaxonIDs, options, this, IsCancelled);
                this.InvokeIfRequired(() => {
                    btnStart.IsEnabled  = true;
                    btnCancel.IsEnabled = false;
                });
            });
        }
Пример #2
0
        public static int GetTraitCategoryTypeID(TraitCategoryType type)
        {
            lock (_IDMap) {
                if (!_IDMap.ContainsKey(type)) {
                    var service = new XMLIOService(PluginManager.Instance.User);
                    var id = service.GetTraitCategoryID(type.ToString());
                    _IDMap[type] = id;
                }
            }

            return _IDMap[type];
        }
        private void AddMaterialRowsForTaxon(DataMatrix results, Taxon taxon)
        {
            var ids = XMLIOService.GetMaterialForTaxon(taxon.TaxaID.Value);

            foreach (XMLIOMaterialID id in ids)
            {
                var links = SupportService.GetMultimediaItems(TraitCategoryType.Material.ToString(), id.MaterialID);
                foreach (MultimediaLink link in links)
                {
                    AddTaxonRow(results, taxon, link, "Material", id.MaterialID);
                }
            }
        }
Пример #4
0
        public static int GetTraitCategoryTypeID(TraitCategoryType type)
        {
            lock (_IDMap) {
                if (!_IDMap.ContainsKey(type))
                {
                    var service = new XMLIOService(PluginManager.Instance.User);
                    var id      = service.GetTraitCategoryID(type.ToString());
                    _IDMap[type] = id;
                }
            }

            return(_IDMap[type]);
        }
Пример #5
0
        private void StartExport()
        {
            _isCancelled = false;

            // save the file off in prefs for later...
            Config.SetUser(User, "XMLIOExport.LastExportFile", txtFilename.Text);

            if (string.IsNullOrEmpty(txtFilename.Text)) {
                ErrorMessage.Show("You must select a destination file before you can continue");
                return;
            }

            btnStart.IsEnabled = false;
            btnCancel.IsEnabled = true;

            var options = new XMLIOExportOptions { Filename = this.Filename, ExportChildTaxa = this.ExportChildTaxa, ExportMaterial = this.ExportMaterial, ExportTraits = this.ExportNotes, ExportMultimedia = this.ExportMultimedia, ExportNotes = this.ExportNotes, IncludeFullClassification = this.IncludeFullClassification, KeepLogFile = this.KeepLogFile };

            var service = new XMLIOService(User);
            JobExecutor.QueueJob(() => {
                service.ExportXML(TaxonIDs, options, this, IsCancelled);
                this.InvokeIfRequired(() => {
                    btnStart.IsEnabled = true;
                    btnCancel.IsEnabled = false;
                });
            });
        }