Added Code Changes and Manual Changes Headings

Changed Clipboard to support Rich Text as well as ASCII text.
This commit is contained in:
Rich 2012-11-13 16:08:48 +00:00
parent 77338c048d
commit 74c96fb09c

View File

@ -434,8 +434,16 @@ namespace Sync
} }
private void listToClipboardToolStripMenuItem_Click(object sender, EventArgs e) private void listToClipboardToolStripMenuItem_Click(object sender, EventArgs e)
{ {
dgv.EndEdit(); RichTextBox rtb = new RichTextBox();
Font fntNormal = new Font("Arial", 10, FontStyle.Regular);
rtb.Font = fntNormal;
Font fntBold = new Font("Arial", 12, FontStyle.Bold);
Font fntItalic = new Font("Arial", 11, FontStyle.Italic);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.Append("Code Changes:\r\n\r\n");
AddText(rtb, fntBold, "Code Changes:");
AddText(rtb, fntNormal, "\r\n\r\n");
dgv.EndEdit();
int lenFolder = tbDevelopment.Text.Length; int lenFolder = tbDevelopment.Text.Length;
string lastFolder = ""; string lastFolder = "";
foreach (FileCompare fc in _CheckedOut) foreach (FileCompare fc in _CheckedOut)
@ -448,19 +456,36 @@ namespace Sync
if (folder != lastFolder) if (folder != lastFolder)
{ {
sb.Append(folder + ":\r\n"); sb.Append(folder + ":\r\n");
AddText(rtb, fntItalic, folder + ":\r\n");
lastFolder = folder; lastFolder = folder;
} }
sb.Append((fis.Exists ? "" : " =>NEW") + "\t" + fi.Name + "\r\n"); sb.Append((fis.Exists ? "" : " =>NEW") + "\t" + fi.Name + "\r\n");
AddText(rtb, fntNormal, (fis.Exists ? "" : " =>NEW") + "\t" + fi.Name + "\r\n");
} }
} }
sb.Append("\r\nInternal Release:\r\n\r\n");
sb.Append("\r\nExternal Release:\r\n\r\n");
sb.Append("\r\nTesting Performed:\r\n\r\n");
sb.Append("\r\nTesting Requirements:\r\n\r\n");
sb.Append("\r\nManual Changes/Additions:\r\n\r\n");
AddText(rtb, fntNormal, "\r\n");
AddText(rtb, fntBold, "Internal Release:");
AddText(rtb, fntNormal, "\r\n\r\n\r\n\r\n");
AddText(rtb, fntBold, "External Release:");
AddText(rtb, fntNormal, "\r\n\r\n\r\n\r\n");
AddText(rtb, fntBold, "Testing Performed:");
AddText(rtb, fntNormal, "\r\n\r\n\r\n\r\n");
AddText(rtb, fntBold, "Testing Requirements:");
AddText(rtb, fntNormal, "\r\n\r\n\r\n\r\n");
AddText(rtb, fntBold, "Manual Changes/Additions:");
AddText(rtb, fntNormal, "\r\n\r\n");
try try
{ {
sb.Append("\r\nInternal Release:\r\n");
sb.Append("\r\nExternal Release:\r\n");
sb.Append("\r\nTesting Performed:\r\n");
sb.Append("\r\nTesting Requirements:\r\n");
Clipboard.Clear(); Clipboard.Clear();
Clipboard.SetText(sb.ToString()); Clipboard.SetText(sb.ToString());
//DataObject dataobj = new DataObject(DataFormats.Rtf,rtb.Rtf);
Clipboard.SetData(DataFormats.Rtf, rtb.Rtf);
MessageBox.Show(sb.ToString(), "Copied to Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show(sb.ToString(), "Copied to Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Information);
} }
catch (Exception ex) catch (Exception ex)
@ -475,6 +500,13 @@ namespace Sync
MessageBox.Show(sb2.ToString(), "Error saving Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Error); MessageBox.Show(sb2.ToString(), "Error saving Clipboard", MessageBoxButtons.OK, MessageBoxIcon.Error);
} }
} }
private static void AddText(RichTextBox rtb, Font fntBold, string txt)
{
rtb.Select(rtb.TextLength, 0);
rtb.SelectionFont = fntBold;
rtb.SelectedText = txt;
}
private void dgv_MouseDown(object sender, MouseEventArgs e) private void dgv_MouseDown(object sender, MouseEventArgs e)
{ {
dgv.ClearSelection(); dgv.ClearSelection();