Exemplo n.º 1
0
 protected override void OnKeyDown(KeyEventArgs e)
 {
     base.OnKeyDown(e);
     if (e.KeyData == (Keys.Control | Keys.C))
     {
         QTTabBarClass.SetStringClipboard(Text + Environment.NewLine + Environment.NewLine + labelMessage.Text);
     }
 }
        private void CopyFileNames(bool fPath)
        {
            List <string>          lstPaths = new List <string>();
            DropDownMenuDropTarget root     = GetRoot(this);

            if (root != null)
            {
                GetCheckedItem(root, lstPaths, false, true);
            }
            if (lstPaths.Count == 0)
            {
                foreach (ToolStripItem item in this.DisplayedItems)
                {
                    if (!item.Selected)
                    {
                        continue;
                    }
                    QMenuItem item2 = item as QMenuItem;
                    if ((item2 != null) && !string.IsNullOrEmpty(item2.Path))
                    {
                        string path = item2.Path;
                        if (!fPath)
                        {
                            try {
                                path = System.IO.Path.GetFileName(path);
                            }
                            catch {
                            }
                        }
                        if (!string.IsNullOrEmpty(path))
                        {
                            QTTabBarClass.SetStringClipboard(path);
                            fContainsFileDropList         = false;
                            this.itemKeyInsertionMarkPrev = null;
                            base.Invalidate();
                        }
                    }
                    break;
                }
            }
            else
            {
                string str = string.Empty;
                foreach (string str3 in lstPaths)
                {
                    if (fPath)
                    {
                        str = str + str3 + Environment.NewLine;
                    }
                    else
                    {
                        try {
                            str = str + System.IO.Path.GetFileName(str3) + Environment.NewLine;
                            continue;
                        }
                        catch {
                            continue;
                        }
                    }
                }
                if (str.Length > 0)
                {
                    QTTabBarClass.SetStringClipboard(str);
                    fContainsFileDropList         = false;
                    this.itemKeyInsertionMarkPrev = null;
                    base.Invalidate();
                }
            }
        }