private SearchResultInformationDialog()
 {
     m_Instance = this;
     InitializeComponent();
     m_DataGridView.SelectionChanged += new EventHandler(m_DataGridView_SelectionChanged);
     if (m_DataGridView.SelectedRows.Count > 0)
         Skip(m_DataGridView.SelectedRows[0].Index);
 }
 private SearchResultInformationDialog()
 {
     m_Instance = this;
     InitializeComponent();
     m_DataGridView.SelectionChanged += new EventHandler(m_DataGridView_SelectionChanged);
     if (m_DataGridView.SelectedRows.Count > 0)
     {
         Skip(m_DataGridView.SelectedRows[0].Index);
     }
 }
 private void SearchResultInformationDialog_FormClosed(object sender, FormClosedEventArgs e)
 {
     m_DataGridView.SelectionChanged -= new EventHandler(m_DataGridView_SelectionChanged);
     toolStripContainer.ContentPanel.Controls.Clear();
     if (m_InformationControl != null)
     {
         m_InformationControl.Dispose();
     }
     if (m_SourcesControl != null)
     {
         m_SourcesControl.Dispose();
     }
     m_Instance = null;
 }
 private void SearchResultInformationDialog_FormClosed(object sender, FormClosedEventArgs e)
 {
     m_DataGridView.SelectionChanged -= new EventHandler(m_DataGridView_SelectionChanged);
     toolStripContainer.ContentPanel.Controls.Clear();
     if (m_InformationControl != null)
         m_InformationControl.Dispose();
     if (m_SourcesControl != null)
         m_SourcesControl.Dispose();
     m_Instance = null;
 }
Esempio n. 5
0
        public SearchControl(MainForm mainForm)
        {
            if (mainForm == null)
            {
                throw new ArgumentNullException("mainForm");
            }

            m_MainForm = mainForm;
            RShare.MainForm.SetUILanguage();
            InitializeComponent();
            searchesDataGridView.Sort(searchesDataGridView.Columns["Pattern"], ListSortDirection.Ascending);
            resultsDataGridView.Sort(resultsDataGridView.Columns["Sources"], ListSortDirection.Descending);
            // 2007-05-28 T.Norad
            FileTypeFilterComboBox.Items.Add(new AnyFileType());
            FileTypeFilterComboBox.Items.Add(new ArchiveFileType());
            FileTypeFilterComboBox.Items.Add(new AudioFileType());
            FileTypeFilterComboBox.Items.Add(new CDImageFileType());
            FileTypeFilterComboBox.Items.Add(new DocumentFileType());
            FileTypeFilterComboBox.Items.Add(new ImageFileType());
            FileTypeFilterComboBox.Items.Add(new ProgramFileType());
            FileTypeFilterComboBox.Items.Add(new SNCollectionFileType());
            FileTypeFilterComboBox.Items.Add(new VideoFileType());
            // preselect always the first entry. cause the default filter is AnyType
            FileTypeFilterComboBox.SelectedIndex = 0;
            // 2008-07-15 T.Norad: BZ58 fixed the drop down item count to display all contained items
            FileTypeFilterComboBox.MaxDropDownItems = FileTypeFilterComboBox.Items.Count;

            //2009-02-01 Nochbaer
            SearchTypeComboBox.SelectedIndex = 0;
            if (!bool.Parse(m_Settings["ActivateSearchDB"]))
            {
                SearchTypeComboBox.Enabled = false;
            }


            SearchResultInformationDialog.Initialize(resultsDataGridView);

            //2008-07-28 Nochbaer BZ 56 load order of columns
            try
            {
                splitContainer.SplitterDistance = (Int32.Parse(m_Settings["searchSplitterDistance"]) * this.Width) / 100;

                searchesDataGridView.Columns["Pattern"].DisplayIndex  = Int32.Parse(m_Settings["searchesPatternIndex"]);
                searchesDataGridView.Columns["Pattern"].FillWeight    = float.Parse(m_Settings["searchesPatternWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                searchesDataGridView.Columns["IsActive"].DisplayIndex = Int32.Parse(m_Settings["searchesIsActiveIndex"]);
                searchesDataGridView.Columns["IsActive"].FillWeight   = float.Parse(m_Settings["searchesIsActiveWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                searchesDataGridView.Columns["Results"].DisplayIndex  = Int32.Parse(m_Settings["searchesResultsIndex"]);
                searchesDataGridView.Columns["Results"].FillWeight    = float.Parse(m_Settings["searchesResultsWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));

                resultsDataGridView.Columns["Icon"].DisplayIndex       = Int32.Parse(m_Settings["resultsIconIndex"]);
                resultsDataGridView.Columns["Icon"].FillWeight         = float.Parse(m_Settings["resultsIconWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["RatingIcon"].DisplayIndex = Int32.Parse(m_Settings["resultsRatingIconIndex"]);
                resultsDataGridView.Columns["RatingIcon"].FillWeight   = float.Parse(m_Settings["resultsRatingIconWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["FileName"].DisplayIndex   = Int32.Parse(m_Settings["resultsFileNameIndex"]);
                resultsDataGridView.Columns["FileName"].FillWeight     = float.Parse(m_Settings["resultsFileNameWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["FileSize"].DisplayIndex   = Int32.Parse(m_Settings["resultsFileSizeIndex"]);
                resultsDataGridView.Columns["FileSize"].FillWeight     = float.Parse(m_Settings["resultsFileSizeWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["Sources"].DisplayIndex    = Int32.Parse(m_Settings["resultsSourcesIndex"]);
                resultsDataGridView.Columns["Sources"].FillWeight      = float.Parse(m_Settings["resultsSourcesWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["Album"].DisplayIndex      = Int32.Parse(m_Settings["resultsAlbumIndex"]);
                resultsDataGridView.Columns["Album"].FillWeight        = float.Parse(m_Settings["resultsAlbumWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["Artist"].DisplayIndex     = Int32.Parse(m_Settings["resultsArtistIndex"]);
                resultsDataGridView.Columns["Artist"].FillWeight       = float.Parse(m_Settings["resultsArtistWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["Title"].DisplayIndex      = Int32.Parse(m_Settings["resultsTitleIndex"]);
                resultsDataGridView.Columns["Title"].FillWeight        = float.Parse(m_Settings["resultsTitleWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
                resultsDataGridView.Columns["Age"].DisplayIndex        = Int32.Parse(m_Settings["resultsAgeIndex"]);
                resultsDataGridView.Columns["Age"].FillWeight          = float.Parse(m_Settings["resultsAgeWidth"], System.Globalization.CultureInfo.CreateSpecificCulture("de-de"));
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show("Error loading style of columns\n\n" + ex.Message, "SearchControl", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            m_start = false;
        }
Esempio n. 6
0
 private void showInformationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     SearchResultInformationDialog.ShowInformation(this);
 }