예제 #1
0
        public static void GroupMenu_ItemRightClicked(object sender, ItemRightClickedEventArgs e)
        {
            DropDownMenuReorderable reorderable = (DropDownMenuReorderable)sender;
            string path = TrackGroupContextMenu(e.ClickedItem.Text, e.IsKey ? e.Point : Control.MousePosition, reorderable.Handle);

            if (!string.IsNullOrEmpty(path))
            {
                Action <QTTabBarClass> open = tabBar => {
                    using (IDLWrapper idlw = new IDLWrapper(path)) {
                        tabBar.OpenNewTabOrWindow(idlw);
                    }
                };
                QTTabBarClass threadBar = InstanceManager.GetThreadTabBar();
                if (threadBar != null)
                {
                    open(threadBar);
                }
                else
                {
                    InstanceManager.InvokeMain(open);
                }
            }
            else
            {
                e.HRESULT = 0xfffd;
            }
        }
예제 #2
0
 private void dataGridView1_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex >= 0 && e.ColumnIndex > 0)
     {
         string path = dgvHash.Rows[e.RowIndex].Cells[1].ToolTipText;
         InstanceManager.InvokeMain(tabBar => {
             using (IDLWrapper idlw = new IDLWrapper(Path.GetDirectoryName(path))) {
                 if (idlw.Available)
                 {
                     tabBar.OpenNewTabOrWindow(idlw);
                 }
             }
         });
     }
 }
예제 #3
0
        private void btnPluginOptions_Click(object sender, RoutedEventArgs e)
        {
            PluginEntry entry = (PluginEntry)((Button)sender).DataContext;
            string      pid   = entry.PluginID;

            // Unfortunately, we can't call Plugin.OnOption on plugins that are
            // loaded in a non-static context.
            InstanceManager.InvokeMain(tabbar => {
                Plugin p;
                if (!tabbar.pluginServer.TryGetPlugin(pid, out p) || p.Instance == null)
                {
                    return;
                }
                try {
                    p.Instance.OnOption();
                }
                catch (Exception ex) {
                    PluginManager.HandlePluginException(ex, new WindowInteropHelper(Window.GetWindow(this)).Handle,
                                                        entry.Name, "Open plugin option.");
                }
            });
        }