public ITerminologyProvider CreateTerminologyProvider(Uri terminologyProviderUri,
            ITerminologyProviderCredentialStore credentials)
        {
            TelemetryService.Instance.Init();
            var persistenceService = new PersistenceService();

            var termSearchService = new NormalTermSeachService();
            var providerSettings = persistenceService.Load(terminologyProviderUri);
            var terminologyProvider = new TerminologyProviderExcel(providerSettings, termSearchService);
            Task.Run(terminologyProvider.LoadEntries);
            return terminologyProvider;
        }
        public ITerminologyProvider[] Browse(IWin32Window owner, ITerminologyProviderCredentialStore credentialStore)
        {
            TelemetryService.Instance.Init();
            var settingsDialog = new Settings();
            settingsDialog.ShowDialog();

            var providerUri=settingsDialog.GetProviderUri();
            var persistenceService = new PersistenceService();
            var termSearchService = new NormalTermSeachService();
            var providerSettings = persistenceService.Load(providerUri);

            var excelProvider = new TerminologyProviderExcel(providerSettings, termSearchService);

            return new ITerminologyProvider[] {excelProvider};
        }
Esempio n. 3
0
        public TermsList(List<ExcelEntry> terms,Uri uri):this()
        {
            _terms = terms;
            _uri = uri;

            var persistenceService = new PersistenceService();
            _providerSettings = persistenceService.Load(_uri);
            if (string.IsNullOrEmpty(_providerSettings.ApprovedColumn))
            {
                this.Approved.Visible = false;
            }
            var excelTermLoaderService = new ExcelTermLoaderService(_providerSettings);
            var parser = new Parser(_providerSettings);
            _transformerService = new EntryTransformerService(parser);

            _excelTermProviderService = new ExcelTermProviderService(excelTermLoaderService,
                _transformerService);
        }
Esempio n. 4
0
        private void submitBtn_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(separatorTextBox.Text) || string.IsNullOrWhiteSpace(pathTextBox.Text))
            {
                MessageBox.Show(@"Please complete all fields", "", MessageBoxButtons.OK);
                return;
            }

            var provider = new ProviderSettings
            {
                HasHeader = hasHeader.Checked,
                ApprovedColumn = approvedBox.Text,
                SourceColumn = sourceBox.Text,
                TargetColumn = targetBox.Text,
                SourceLanguage = (CultureInfo) sourceLanguageComboBox.SelectedItem,
                TargetLanguage = (CultureInfo) targetLanguageComboBox.SelectedItem,
                Separator = separatorTextBox.Text[0],
                TermFilePath = pathTextBox.Text,
            };

            var termSearchService = new NormalTermSeachService();
            var persistence = new PersistenceService();
            var excelProvider = new TerminologyProviderExcel(provider, termSearchService);

            provider.Uri = excelProvider.Uri;
            _providerUri = provider.Uri;
            persistence.AddSettings(provider);
            persistence.Save();

            Close();
        }