Exemple #1
0
        private void editorsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormViewers fe = new FormViewers(m_config);

            if (fe.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
            {
                AppConfigIO.Write <AppConfig>(m_config);
            }
        }
Exemple #2
0
 private void WriteConfig()
 {
     try
     {
         AppConfigIO.Write <AppConfig>(m_config);
     }
     catch (SystemException ex)
     {
         Debug.WriteLine("[{0}][{1}]", ex.Source, ex.Message);
     }
 }
Exemple #3
0
        private void ReadConfig()
        {
            AppConfig config = new AppConfig();

            try
            {
                AppConfigIO.Read <AppConfig>(ref config);
            }
            catch (SystemException ex)
            {
                Debug.WriteLine("[{0}][{1}]", ex.Source, ex.Message);
            }

            cbPath.Items.Clear();
            cbFiltersInclusion.Items.Clear();
            cbKeywords.Items.Clear();
            cbSearchHistory.Items.Clear();

            foreach (SearchParams searchParams in config.SearchParamsHistory)
            {
                if (!cbPath.Items.Contains(searchParams.Path))
                {
                    cbPath.Items.Add(searchParams.Path);
                }
                if (!cbFiltersInclusion.Items.Contains(searchParams.FiltersInclusions))
                {
                    cbFiltersInclusion.Items.Add(searchParams.FiltersInclusions);
                }
                if (!cbFiltersExclusion.Items.Contains(searchParams.FiltersExclusions))
                {
                    cbFiltersExclusion.Items.Add(searchParams.FiltersExclusions);
                }
                if (!cbKeywords.Items.Contains(searchParams.Keywords))
                {
                    cbKeywords.Items.Add(searchParams.Keywords);
                }

                cbSearchHistory.Items.Add(searchParams.DisplayID);
            }

            m_config = config;
            SetHistoryConfig(0);
        }