Exemplo n.º 1
0
        private async Task RedrawForm()
        {
            if (_profile != null)
            {
                _solrIdentifier = Create.WithCurrentProfile <ISolrIdentifier>(_view);
                _solrIdentifier.OnProgressReady += (sender, args) => _viewHelper.UpdateProgress(args.Value);

                if (!_profile.RemotingEnabled || _profile.RemoteFolder.NotEmpty())
                {
                    _view.ShowSpinnerHideGrid(true);

                    try
                    {
                        _viewHelper.SetSolrGrid(await _solrIdentifier.Identify(), _profile?.RemotingEnabled ?? false);
                    }
                    catch (RemoteNotInitializedException)
                    {
                        ShowConnectivityError();
                    }
                    catch
                    {
                        // need to silently continue here
                    }

                    _view.ShowSpinnerHideGrid(false);
                }
                else
                {
                    _viewHelper.NotifyRemoteNotInitialized();
                }
            }
        }
Exemplo n.º 2
0
        private async void RedrawForm()
        {
            if (SelectedProfile != null)
            {
                _view.LoadDatabaseServersDropdown(Presenter.SqlServerNames, SelectedProfile.SqlServerRecord?.RecordName);
                _view.LoadSolrDropdown();
                _view.SetSolrValue(SelectedProfile?.Solr);

                //TODO : Re-use here
                _solrIdentifier = Create.WithCurrentProfile <ISolrIdentifier>(_view); // new SolrIdentifier( _view);
                _solrIdentifier.OnProgressReady += (sender, args) => _view.UpdateProgress(args.Value);

                if (!SelectedProfile.RemotingEnabled || SelectedProfile.RemoteFolder.NotEmpty())
                {
                    _view.ShowSpinnerHideGrid(true);

                    try
                    {
                        if (SelectedProfile != null)
                        {
                            _view.SetSolrGrid(await _solrIdentifier.Identify(), SelectedProfile?.RemotingEnabled ?? false);
                            _view.SetSolrDropdownByProfile(SelectedProfile?.Solr);
                        }
                    }
                    catch (RemoteNotInitializedException)
                    {
                        ShowConnectivityError();
                    }
                    catch
                    {
                        // need to silently continue here
                    }

                    _view.ShowSpinnerHideGrid(false);
                }
                else
                {
                    _view.NotifyRemoteNotInitialized();
                }
            }
        }