コード例 #1
0
        private void BtnCopySummary_Click(object sender, EventArgs e)
        {
            string cliptext = "";

            cliptext += "Name: " + Path.GetFileNameWithoutExtension(tp.ProjectFile) + "\n";
            if (tPackedLogsURL.Text != string.Empty)
            {
                cliptext += "Logs: <" + tPackedLogsURL.Text + ">\n";
            }
            if (tYoutubeURL.Text != string.Empty)
            {
                cliptext += "Video: " + tYoutubeURL.Text + "\n";
            }
            var t = VisualTagsToString();

            if (t != string.Empty)
            {
                cliptext += "Tags: " + t + "\n";
            }
            try
            {
                // Because nothing is ever as simple as the next line >.>
                // Clipboard.SetText(s);
                // Helper will (try to) prevent errors when copying to clipboard because of threading issues
                var cliphelp = new SetClipboardHelper(DataFormats.Text, cliptext);
                cliphelp.DontRetryWorkOnFailed = false;
                cliphelp.Go();
            }
            catch
            {
            }
        }
コード例 #2
0
 private void SendToClipBoard(string cliptext)
 {
     try
     {
         // Because nothing is ever as simple as the next line >.>
         // Clipboard.SetText(s);
         // Helper will (try to) prevent errors when copying to clipboard because of threading issues
         var cliphelp = new SetClipboardHelper(DataFormats.Text, cliptext);
         cliphelp.DontRetryWorkOnFailed = false;
         cliphelp.Go();
     }
     catch
     {
     }
 }