Esempio n. 1
0
        private WebServicesDialog(WebServicesSettings settings, CatalogSettings catalogSettings, KeywordsSettings keywordsSettings,
                                  IMetadataFetcherPlugin metadataFetcher, AppManager App, RectangleDrawing _rectangleDrawing)
        {
            _app = App;
            this._rectangleDrawing = _rectangleDrawing;
            InitializeComponent();

            _settings         = settings;
            _catalogSettings  = catalogSettings;
            _keywordsSettings = keywordsSettings;
            _metadataFetcher  = metadataFetcher;


            switch (_catalogSettings.TypeOfCatalog)
            {
            case TypeOfCatalog.HisCentral:
                rbHisCentral.Checked = true;
                local = false;
                break;

            case TypeOfCatalog.LocalMetadataCache:
                rbLocalMetadataCache.Checked = true;
                local = true;
                break;
            }
            webServicesUserControl1.SetSettings(settings, catalogSettings, local);

            rbHisCentral.CheckedChanged         += rbTypeOfCatalog_CheckedChanged;
            rbLocalMetadataCache.CheckedChanged += rbTypeOfCatalog_CheckedChanged;
            UpdateCatalogSettings();
        }
Esempio n. 2
0
        public static DialogResult ShowDialog(WebServicesSettings settings, CatalogSettings catalogSettings,
                                              KeywordsSettings keywordsSettings, IMetadataFetcherPlugin metadataFetcher, AppManager App, RectangleDrawing _rectangleDrawing)
        {
            if (settings == null)
            {
                throw new ArgumentNullException("settings");
            }
            if (catalogSettings == null)
            {
                throw new ArgumentNullException("catalogSettings");
            }
            if (keywordsSettings == null)
            {
                throw new ArgumentNullException("keywordsSettings");
            }



            using (var form = new WebServicesDialog(settings.Copy(), catalogSettings.Copy(), keywordsSettings.Copy(), metadataFetcher, App, _rectangleDrawing))
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    if (catalogSettings.TypeOfCatalog != form._catalogSettings.TypeOfCatalog ||
                        catalogSettings.HISCentralUrl != form._catalogSettings.HISCentralUrl)
                    {
                        form.RefreshKeywords();
                    }

                    settings.Copy(form._settings);
                    catalogSettings.Copy(form._catalogSettings);
                    // keywordsSettings.Copy(form._keywordsSettings);
                }

                return(form.DialogResult);
            }
        }