Пример #1
0
        private void DrawLinks(IEnumerable <ThingInMemory> thingInMemories)
        {
            var c = GUI.backgroundColor;

            GUI.skin.button.alignment = TextAnchor.UpperLeft;
            foreach (var rb in thingInMemories)
            {
                EditorGUI.BeginDisabledGroup(rb == _selectedThing || rb == null);

                GUI.backgroundColor = ColorFor(rb);

                var caption = rb == null ? "null" : rb.caption;

                var managedObject = rb as ManagedObject;
                if (managedObject != null && managedObject.typeDescription.name == "System.String")
                {
                    caption = StringTools.ReadString(_unpackedCrawl.managedHeap.Find(managedObject.address, _unpackedCrawl.virtualMachineInformation), _unpackedCrawl.virtualMachineInformation);
                }

                if (GUILayout.Button(caption))
                {
                    _hostWindow.SelectThing(rb);
                }
                EditorGUI.EndDisabledGroup();
            }
            GUI.backgroundColor = c;
        }
Пример #2
0
        private void HandleMouseClick()
        {
            if ((Event.current.type == EventType.MouseDown || Event.current.type == EventType.MouseUp) && Event.current.button == 0)
            {
                if (_ZoomArea.drawRect.Contains(Event.current.mousePosition))
                {
                    Group group = _groups.Values.FirstOrDefault(i => i._position.Contains(mouseTreemapPosition));
                    Item  item  = _items.FirstOrDefault(i => i._position.Contains(mouseTreemapPosition));

                    if (item != null && _selectedGroup == item._group)
                    {
                        switch (Event.current.type)
                        {
                        case EventType.MouseDown:
                            _mouseDownItem = item;
                            break;

                        case EventType.MouseUp:
                            if (_mouseDownItem == item)
                            {
                                _hostWindow.SelectThing(item._thingInMemory);
                                Event.current.Use();
                            }
                            break;
                        }
                    }
                    else if (group != null)
                    {
                        switch (Event.current.type)
                        {
                        case EventType.MouseUp:
                            _hostWindow.SelectGroup(group);
                            Event.current.Use();
                            break;
                        }
                    }
                }
            }
        }