Exemplo n.º 1
0
        public RetentionTreeViewer(ClrRuntime runtime, List <String> managedObjects)
        {
            this.runtime = runtime;
            InitializeComponent();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));

            if (runtime != null)
            {
                Cursor.Current = Cursors.WaitCursor;
                List <ClrTypeHelper> c = new List <ClrTypeHelper>();
                foreach (String s in managedObjects)
                {
                    c.AddRange(ClrMdHelper.GetPtrsForObjectName(runtime, s));
                }

                comboBoxClrMdTypes.Items.AddRange(c.ToArray());

                Cursor.Current = Cursors.Default;
            }
            else
            {
                openFileDialog();
            }
        }
Exemplo n.º 2
0
        public ObjectInspector(ClrRuntime runtime, List <String> managedObjects)
        {
            Cursor.Current = Cursors.WaitCursor;
            this.runtime   = runtime;
            InitializeComponent();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));


            List <ClrTypeHelper> typeList = new List <ClrTypeHelper>();

            foreach (String s in managedObjects.OrderBy(x => x))
            {
                typeList.AddRange(ClrMdHelper.GetPtrsForObjectName(runtime, s));
            }

            this.treeViewObjects.Nodes.Clear();

            foreach (ClrTypeHelper c in typeList)
            {
                TreeNode node = new TreeNode(c.Name)
                {
                    Tag = c
                };
                c.TreeNode = node;
                node.Nodes.Add(new TreeNode());
                treeViewObjects.Nodes.Add(node);
                globalSearchList.Add(c);
            }
            Cursor.Current = Cursors.Default;
        }