Пример #1
0
 void OnLiveUpdateButtonClicked(object sender, EventArgs e)
 {
     if (Node != null && pinned)
     {
         DebuggingService.SetLiveUpdateMode(TreeView.PinnedWatch, !TreeView.PinnedWatch.LiveUpdate);
         Node.Refresh();
     }
 }
        protected override bool OnButtonPressEvent(Gdk.EventButton evnt)
        {
            allowStoreColumnSizes = true;
            bool           res = base.OnButtonPressEvent(evnt);
            TreePath       path;
            TreeViewColumn col;
            CellRenderer   cr;

            if (evnt.Button == 1 && GetCellAtPos((int)evnt.X, (int)evnt.Y, out path, out col, out cr))
            {
                TreeIter it;
                store.GetIter(out it, path);
                if (cr == crpViewer)
                {
                    ObjectValue val = (ObjectValue)store.GetValue(it, ObjectCol);
                    DebuggingService.ShowValueVisualizer(val);
                }
                else if (!editing)
                {
                    if (cr == crpButton)
                    {
                        RefreshRow(it);
                    }
                    else if (cr == crpPin)
                    {
                        TreeIter pi;
                        if (PinnedWatch != null && !store.IterParent(out pi, it))
                        {
                            RemovePinnedWatch(it);
                        }
                        else
                        {
                            CreatePinnedWatch(it);
                        }
                    }
                    else if (cr == crpLiveUpdate)
                    {
                        TreeIter pi;
                        if (PinnedWatch != null && !store.IterParent(out pi, it))
                        {
                            DebuggingService.SetLiveUpdateMode(PinnedWatch, !PinnedWatch.LiveUpdate);
                            if (PinnedWatch.LiveUpdate)
                            {
                                store.SetValue(it, LiveUpdateIconCol, liveIcon);
                            }
                            else
                            {
                                store.SetValue(it, LiveUpdateIconCol, noLiveIcon);
                            }
                        }
                    }
                }
            }

            if (evnt.Button == 3)
            {
                ShowPopup();
            }

            return(res);
        }