예제 #1
0
        public bool Edit(IWin32Window owner, ITerminologyProvider terminologyProvider)
        {
            if (!IATEApplication.ConnectionProvider.EnsureConnection())
            {
                var exception = new Exception("Failed login!");
                _logger.Error(exception);

                throw exception;
            }

            var provider = terminologyProvider as IATETerminologyProvider;

            if (provider == null)
            {
                return(false);
            }

            var messageBoxService = new MessageBoxService();

            //_settingsViewModel = new SettingsViewModel(provider.ProviderSettings, provider.InventoriesProvider, provider.CacheProvider, messageBoxService);
            _mainWindow = IATEApplication.GetMainWindow();

            if (!_mainWindow.ShowDialog() ?? false)
            {
                return(false);
            }

            provider.ProviderSettings = _mainWindow.ProviderSettings;

            return(true);
        }
예제 #2
0
        public ITerminologyProvider[] Browse(IWin32Window owner, ITerminologyProviderCredentialStore credentialStore)
        {
            _mainWindow = IATEApplication.GetMainWindow();
            if (_mainWindow != null)
            {
                _mainWindow.ShowDialog();
                if (!_mainWindow?.DialogResult ?? true)
                {
                    return(null);
                }

                var provider = new IATETerminologyProvider(_mainWindow.ProviderSettings, IATEApplication.ConnectionProvider,
                                                           IATEApplication.InventoriesProvider, IATEApplication.CacheProvider);

                return(new ITerminologyProvider[] { provider });
            }

            var exception = new Exception("Failed login!");

            _logger.Error(exception);

            throw exception;
        }