CopyToClipboard() public static method

public static CopyToClipboard ( string text ) : void
text string
return void
Beispiel #1
0
        private void copyStackTraceToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            var item = sqlItemContextStrip.Tag as ExecutionCall;

            if (item != null)
            {
                var stackTrace = item.GetStackTrace();

                StringBuilder sb = new StringBuilder();

                for (var x = 0; x < stackTrace.Count; x++)
                {
                    sb.Append(new string(' ', 4 * x));
                    sb.AppendLine(String.Format("{0}", stackTrace[x].Item2));
                }

                if (MainForm.IsRunningOSX)
                {
                    OSXClipboard.CopyToClipboard(sb.ToString());
                }
                else
                {
                    Clipboard.SetText(sb.ToString());
                }

                MessageBox.Show("Stack trace copied successfully.");
            }
        }
Beispiel #2
0
        private void copyResolvedStatementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var execCall     = sqlItemContextStrip.Tag as ExecutionCall;
            var sqlStatement = execCall.SQLStatement;

            string workingStatement = sqlStatement.Statement;

            foreach (var b in sqlStatement.BindValues.OrderBy(p => p.Index).Reverse())
            {
                var valueString = "";
                if (b.Type == 19)
                {
                    valueString = b.Value;
                }
                else
                {
                    valueString = "'" + b.Value + "'";
                }
                workingStatement = workingStatement.Replace(":" + b.Index, valueString);
            }

            if (MainForm.IsRunningOSX)
            {
                OSXClipboard.CopyToClipboard(workingStatement);
            }
            else
            {
                Clipboard.SetText(workingStatement);
            }

            MessageBox.Show("Resolved statement copied to clipboard.");
        }
Beispiel #3
0
        private void copyStatementToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var execCall     = sqlItemContextStrip.Tag as ExecutionCall;
            var sqlStatement = execCall.SQLStatement;

            if (MainForm.IsRunningOSX)
            {
                OSXClipboard.CopyToClipboard(sqlStatement.Statement);
            }
            else
            {
                Clipboard.SetText(sqlStatement.Statement);
            }

            MessageBox.Show("SQL Statement copied to clipboard.");
        }
Beispiel #4
0
        private void copyBindsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var execCall     = sqlItemContextStrip.Tag as ExecutionCall;
            var sqlStatement = execCall.SQLStatement;

            StringBuilder sb = new StringBuilder();

            foreach (var b in sqlStatement.BindValues)
            {
                sb.AppendLine(String.Format("Bind {0} = {1}", b.Index, b.Value));
            }

            if (MainForm.IsRunningOSX)
            {
                OSXClipboard.CopyToClipboard(sb.ToString());
            }
            else
            {
                Clipboard.SetText(sb.ToString());
            }

            MessageBox.Show("Bind values copied to clipboard.");
        }