Esempio n. 1
0
        /** Edit Menu *************************************************************/

        private void CallbackEditPreferencesClick(object sender, EventArgs e)
        {
            MacroscopePrefsForm PreferencesForm = new MacroscopePrefsForm();
            DialogResult        PreferencesResult;

            int CustomFiltersMaxItems = MacroscopePreferencesManager.GetCustomFiltersMaxItems();

            int DataExtractorsMaxItemsCssSelectors = MacroscopePreferencesManager.GetDataExtractorsMaxItemsCssSelectors();
            int DataExtractorsMaxItemsRegexes      = MacroscopePreferencesManager.GetDataExtractorsMaxItemsRegexes();
            int DataExtractorsMaxItemsXpaths       = MacroscopePreferencesManager.GetDataExtractorsMaxItemsXpaths();

            PreferencesResult = PreferencesForm.ShowDialog();

            if (PreferencesResult == DialogResult.OK)
            {
                PreferencesForm.SavePrefsFormControlFields();

                /** Custom Filters ------------------------------------------------- **/

                this.InitializeCustomFilters();

                /** Data Extractors ------------------------------------------------ **/

                {
                    bool ReconfigureInitializeCssSelectors       = false;
                    bool ReconfigureDataExtractorMaxItemsRegexes = false;
                    bool ReconfigureDataExtractorMaxItemsXpaths  = false;

                    if (DataExtractorsMaxItemsCssSelectors != MacroscopePreferencesManager.GetDataExtractorsMaxItemsCssSelectors())
                    {
                        ReconfigureInitializeCssSelectors = true;
                    }

                    if (DataExtractorsMaxItemsRegexes != MacroscopePreferencesManager.GetDataExtractorsMaxItemsRegexes())
                    {
                        ReconfigureDataExtractorMaxItemsRegexes = true;
                    }

                    if (DataExtractorsMaxItemsXpaths != MacroscopePreferencesManager.GetDataExtractorsMaxItemsXpaths())
                    {
                        ReconfigureDataExtractorMaxItemsXpaths = true;
                    }

                    this.InitializeDataExtractors(
                        InitializeCssSelectors: ReconfigureInitializeCssSelectors,
                        InitializeRegexes: ReconfigureDataExtractorMaxItemsRegexes,
                        InitializeXpaths: ReconfigureDataExtractorMaxItemsXpaths
                        );
                }

                /** Reports Menu --------------------------------------------------- **/

                this.ReconfigureReportsMenu();

                /** ---------------------------------------------------------------- **/

                /** Structure Overview Controls ------------------------------------ **/

                this.ReconfigureStructureOverviewControls();

                /** ---------------------------------------------------------------- **/

                /** Search Controls ------------------------------------------------ **/

                this.ReconfigureSearchCollectionControls();

                /** ---------------------------------------------------------------- **/
            }

            if (PreferencesForm != null)
            {
                PreferencesForm.Dispose();
            }
        }