Example #1
0
 public void Copy()
 {
     if (hexEditContainer.HasSomethingSelected)
     {
         ClipboardWrapper.SetText(hexEditContainer.Copy());
     }
 }
Example #2
0
        void CopyButtonClick(object sender, EventArgs e)
        {
            StringBuilder versionInfo = new StringBuilder();

            foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
            {
                AssemblyName name = asm.GetName();
                versionInfo.Append(name.Name);
                versionInfo.Append(",");
                versionInfo.Append(name.Version.ToString());
                versionInfo.Append(",");
                try
                {
                    versionInfo.Append(asm.Location);
                }
                catch (NotSupportedException)
                {
                    // assembly.Location throws NotSupportedException for assemblies emitted using
                    // Reflection.Emit by custom controls used in the forms designer
                    versionInfo.Append("dynamic");
                }

                versionInfo.Append(Environment.NewLine);
            }

            ClipboardWrapper.SetText(versionInfo.ToString());
        }
Example #3
0
        public void CopySelectionToClipboard()
        {
            StringBuilder b = new StringBuilder();

            foreach (Task t in this.SelectedTasks)
            {
                if (b.Length > 0)
                {
                    b.AppendLine();
                }
                b.Append(t.Description);
                if (!string.IsNullOrEmpty(t.FileName))
                {
                    b.Append(" - ");
                    b.Append(t.FileName);
                    if (t.Line >= 0)
                    {
                        b.Append(':');
                        b.Append(t.Line + 1);
                        if (t.Column > 0)
                        {
                            b.Append(',');
                            b.Append(t.Column + 1);
                        }
                    }
                }
            }
            ClipboardWrapper.SetText(b.ToString());
        }
Example #4
0
        private void CopyInfoToClipboard(bool copyToClipboard)
        {
            if (!copyToClipboard)
            {
                return;
            }

            // TODO: Replace ClipboardWrapper.SetText() with abstraction

            string exceptionText = BuildExceptionText();

            if (Application.OleRequired() == ApartmentState.STA)
            {
                ClipboardWrapper.SetText(exceptionText);
            }
            else
            {
                var thread = new Thread((ThreadStart) delegate
                {
                    ClipboardWrapper.SetText(exceptionText);
                });
                thread.Name = nameof(CopyInfoToClipboard);
                thread.SetApartmentState(ApartmentState.STA);
                thread.Start();
            }
        }
Example #5
0
        /// <summary>
        /// Starts the command
        /// </summary>
        public override void Run()
        {
            Editor editor = Owner as Editor;

            if (editor != null)
            {
                ClipboardWrapper.SetText(editor.CopyAsHexString());
            }
        }
        public override void Run()
        {
            ResourceEditorControl editor = ((ResourceEditWrapper)WorkbenchSingleton.Workbench.ActiveViewContent).ResourceEditor;

            if (editor.ResourceList.SelectedItems.Count > 0)
            {
                ClipboardWrapper.SetText(editor.ResourceList.SelectedItems[0].Text);
            }
        }
        public override void Run()
        {
            IWorkbenchWindow window = Owner as IWorkbenchWindow;

            if (window != null && window.ViewContent.FileName != null)
            {
                ClipboardWrapper.SetText(window.ViewContent.FileName);
            }
        }
        public void CopyPRCGToClipboardClicked()
        {
            if (Model.SelectedWorkUnitRow == null)
            {
                return;
            }

            string projectString = Model.SelectedWorkUnitRow.ToProjectString();

            // TODO: Replace ClipboardWrapper.SetText() with abstraction
            ClipboardWrapper.SetText(projectString);
        }
 public override void Run()
 {
     if (this.Owner is WatchPad)
     {
         WatchPad pad  = (WatchPad)this.Owner;
         var      node = pad.WatchList.SelectedNode;
         if (node != null && node.Node is ExpressionNode)
         {
             string text = ((ExpressionNode)node.Node).FullText;
             ClipboardWrapper.SetText(text);
         }
     }
 }
Example #10
0
 private void CopyInfoToClipboard()
 {
     if (copyErrorCheckBox.Checked)
     {
         if (Application.OleRequired() == ApartmentState.STA)
         {
             ClipboardWrapper.SetText(GetExceptionDetailMessage());
         }
         else
         {
             Thread th = new Thread((ThreadStart) delegate { ClipboardWrapper.SetText(GetExceptionDetailMessage()); });
             th.SetApartmentState(ApartmentState.STA);
             th.Start();
         }
     }
 }
Example #11
0
 void CopyInfoToClipboard()
 {
     if (copyErrorCheckBox.Checked)
     {
         if (Application.OleRequired() == ApartmentState.STA)
         {
             ClipboardWrapper.SetText(getClipboardString());
         }
         else
         {
             Thread th = new Thread((ThreadStart) delegate {
                 ClipboardWrapper.SetText(getClipboardString());
             });
             th.Name = "CopyInfoToClipboard";
             th.SetApartmentState(ApartmentState.STA);
             th.Start();
         }
     }
 }
Example #12
0
        public ContextMenuStrip GetContextMenu()
        {
            ContextMenuStrip menu = new ContextMenuStrip();

            ToolStripMenuItem copyItem;

            copyItem         = new ToolStripMenuItem();
            copyItem.Text    = ResourceService.GetString("MainWindow.Windows.Debug.LocalVariables.CopyToClipboard");
            copyItem.Checked = false;
            copyItem.Click  += delegate {
                ClipboardWrapper.SetText(fullText);
            };

            ToolStripMenuItem hexView;

            hexView         = new ToolStripMenuItem();
            hexView.Text    = ResourceService.GetString("MainWindow.Windows.Debug.LocalVariables.ShowInHexadecimal");
            hexView.Checked = DebuggingOptions.Instance.ShowValuesInHexadecimal;
            hexView.Click  += delegate {
                // refresh all pads that use ValueNode for display
                DebuggingOptions.Instance.ShowValuesInHexadecimal = !DebuggingOptions.Instance.ShowValuesInHexadecimal;
                // always check if instance is null, might be null if pad is not opened
                if (LocalVarPad.Instance != null)
                {
                    LocalVarPad.Instance.RefreshPad();
                }
                if (WatchPad.Instance != null)
                {
                    WatchPad.Instance.RefreshPad();
                }
            };

            menu.Items.AddRange(new ToolStripItem[] {
                copyItem,
                hexView
            });

            return(menu);
        }
Example #13
0
        public override void Run()
        {
            IWorkbenchWindow window = Owner as IWorkbenchWindow;

            ClipboardWrapper.SetText(window.ActiveViewContent.PrimaryFileName ?? "");
        }
Example #14
0
 void CopyInfoToClipboard()
 {
     ClipboardWrapper.SetText(GetClipboardString());
 }
 public void Copy()
 {
     ClipboardWrapper.SetText(comboBox.SelectedText);
 }
 public void Cut()
 {
     ClipboardWrapper.SetText(comboBox.SelectedText); comboBox.SelectedText = "";
 }