コード例 #1
0
ファイル: FormMain.cs プロジェクト: omgtehlion/QtSpy
        private void picturePicker_MouseUp(object sender, MouseEventArgs e)
        {
            InvertLast();
            Searching = false;
            if (checkMinimize.Checked)
            {
                ClientSize = SavedSize;
            }

            dataGridParams.Rows.Clear();

            var json = GetWidgetData(LastWindow, true);

            if (json != null)
            {
                MyNode tagged;
                var    root  = QtObject.ParseJson <MyNode>(json, out tagged);
                var    model = MyTreeModel.FromNode(root);
                treeWidgets.Model = model;

                if (tagged != null)
                {
                    treeWidgets.SelectedNode = treeWidgets.FindNode(model.GetPath(tagged));
                    treeWidgets.EnsureVisible(treeWidgets.SelectedNode);
                    treeWidgets.Focus();
                }
            }

            LastWindow          = IntPtr.Zero;
            picturePicker.Image = Properties.Resources.bitmap1;
        }
コード例 #2
0
        public static MyTreeModel FromNode(MyNode node)
        {
            var result = new MyTreeModel();

            result.Root.Children.Add(node);
            node.SetParent(result.Root);
            result.Accept(node);
            return(result);
        }