コード例 #1
0
ファイル: frmMain.cs プロジェクト: joshball/astrogrep
        /// <summary>
        /// Show Print Dialog
        /// </summary>
        /// <param name="sender">system parm</param>
        /// <param name="e">system parm</param>
        /// <history>
        /// [Curtis_Beard]	   01/11/2005	.Net Conversion
        /// [Curtis_Beard]	   09/10/2005	CHG: pass in listView and grep hashtable
        /// [Curtis_Beard]	   10/14/2005	CHG: use No Results for message box title
        /// [Curtis_Beard]	   12/07/2005	CHG: Pass in font name and size to print dialog
        /// [Curtis_Beard]	   10/11/2006	CHG: Pass in font and icon
        /// </history>
        private void PrintResultsMenuItem_Click(object sender, EventArgs e)
        {
            if (lstFileNames.Items.Count > 0)
             {
            // get all grep indexes
            IEnumerable<ListViewItem> lv = lstFileNames.Items.Cast<ListViewItem>();
            var indexes = (from i in lv where i.Selected select int.Parse(i.SubItems[Constants.COLUMN_INDEX_GREP_INDEX].Text)).ToList();

            MatchResultsExport.ExportSettings settings = new MatchResultsExport.ExportSettings()
            {
               Grep = __Grep,
               GrepIndexes = indexes,
               ShowLineNumbers = LineNumbersMenuItem.Checked,
               RemoveLeadingWhiteSpace = RemoveWhiteSpaceMenuItem.Checked
            };

            using (var printForm = new frmPrint(settings, Convertors.ConvertStringToFont(Core.GeneralSettings.ResultsFont), Icon))
            {
               printForm.ShowDialog(this);
            }
             }
             else
            MessageBox.Show(Language.GetGenericText("PrintNoResults"), ProductInformation.ApplicationName, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
コード例 #2
0
ファイル: frmMain.cs プロジェクト: joshball/astrogrep
 /// <summary>
 /// Show Print Dialog
 /// </summary>
 /// <param name="sender">system parm</param>
 /// <param name="e">system parm</param>
 /// <history>
 /// [Curtis_Beard]	   01/11/2005	.Net Conversion
 /// [Curtis_Beard]	   09/10/2005	CHG: pass in listView and grep hashtable
 /// [Curtis_Beard]	   10/14/2005	CHG: use No Results for message box title
 /// [Curtis_Beard]	   12/07/2005	CHG: Pass in font name and size to print dialog
 /// [Curtis_Beard]	   10/11/2006	CHG: Pass in font and icon
 /// </history>
 private void mnuPrintResults_Click(object sender, System.EventArgs e)
 {
     if (lstFileNames.Items.Count > 0)
      {
     frmPrint _form = new frmPrint(lstFileNames, __Grep.Greps, txtHits.Font, this.Icon);
     _form.ShowDialog(this);
     _form = null;
      }
      else
     MessageBox.Show(Language.GetGenericText("PrintNoResults"), Constants.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Information);
 }