private ITerminologyProvider[] SetTerminologyProvider(IATETerminologyProvider provider, ProviderSettings providerSettings)
        {
            var result = new List <ITerminologyProvider>();

            if (_settingsViewModel != null)
            {
                _settingsViewModel.OnSaveSettingsCommandRaised -= GetProviderSettings;
            }

            _settingsViewModel = new SettingsViewModel(providerSettings);
            _settingsWindow    = new SettingsWindow(_settingsViewModel);

            if (_settingsViewModel != null)
            {
                _settingsViewModel.OnSaveSettingsCommandRaised += GetProviderSettings;
            }

            _settingsWindow.ShowDialog();

            providerSettings = _settingsViewModel.ProviderSettings;

            if (provider == null)
            {
                provider = new IATETerminologyProvider(providerSettings);
            }
            else
            {
                provider.UpdateSettings(providerSettings);
            }

            result.Add(provider);

            return(result.ToArray());
        }
예제 #2
0
        private ITerminologyProvider[] SetTerminologyProvider(IATETerminologyProvider provider, SettingsModel providerSettings)
        {
            var result = new List <ITerminologyProvider>();

            _settingsViewModel = new SettingsViewModel(providerSettings, _settingsService);
            _settingsWindow    = new SettingsWindow
            {
                DataContext = _settingsViewModel
            };

            _settingsWindow.ShowDialog();
            if (!_settingsViewModel.DialogResult)
            {
                return(null);
            }
            providerSettings = _settingsViewModel.ProviderSettings;

            if (provider is null)
            {
                provider = new IATETerminologyProvider(providerSettings);
            }
            else
            {
                provider.UpdateSettings(providerSettings);
            }

            result.Add(provider);

            return(result.ToArray());
        }
예제 #3
0
        public ITerminologyProvider CreateTerminologyProvider(Uri terminologyProviderUri, ITerminologyProviderCredentialStore credentials)
        {
            var persistenceService = new PersistenceService();
            var providerSettings   = persistenceService.Load();

            var terminologyProvider = new IATETerminologyProvider(providerSettings);

            return(terminologyProvider);
        }
        private ITerminologyProvider[] SetTerminologyProvider(ProviderSettings providerSettings)
        {
            var result = new List <ITerminologyProvider>();

            _settingsViewModel = new SettingsViewModel(providerSettings);
            _settingsWindow    = new SettingsWindow(_settingsViewModel);
            _settingsViewModel.OnSaveSettingsCommandRaised += GetProviderSettings;

            _settingsWindow.ShowDialog();

            var termSearchService       = new TermSearchService(_settingsViewModel.ProviderSettings);
            var IATETerminologyProvider = new IATETerminologyProvider(_settingsViewModel.ProviderSettings);

            result.Add(IATETerminologyProvider);

            return(result.ToArray());
        }
예제 #5
0
        public ITerminologyProvider CreateTerminologyProvider(Uri terminologyProviderUri, ITerminologyProviderCredentialStore credentials)
        {
            var settingsService  = new IateSettingsService();
            var savedSettings    = settingsService.GetProviderSettings();
            var providerSettings = new SettingsModel
            {
                Domains   = new List <DomainModel>(),
                TermTypes = new List <TermTypeModel>()
            };

            if (savedSettings != null)
            {
                providerSettings.Domains.AddRange(savedSettings.Domains);
                providerSettings.TermTypes.AddRange(savedSettings.TermTypes);
            }
            var terminologyProvider = new IATETerminologyProvider(providerSettings);

            return(terminologyProvider);
        }
        public ITerminologyProvider CreateTerminologyProvider(Uri terminologyProviderUri, ITerminologyProviderCredentialStore credentials)
        {
            var domains = DomainService.GetDomains();

            if (domains.Count == 0)
            {
                GetDomains();
            }
            IATETerminologyProvider terminologyProvider;

            try
            {
                var persistenceService = new PersistenceService();
                var providerSettings   = persistenceService.Load();

                terminologyProvider = new IATETerminologyProvider(providerSettings);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(terminologyProvider);
        }
 public void Release()
 {
     _iateTerminologyProvider = null;
 }
 public void Initialize(ITerminologyProvider terminologyProvider, CultureInfo source, CultureInfo target)
 {
     _iateTerminologyProvider = (IATETerminologyProvider)terminologyProvider;
 }