Exemple #1
0
            public void Restore(TreeMapPane pane)
            {
                if (!m_SelectedItem.Equals(default(Treemap.ObjectMetric)))
                {
                    if (pane.m_TreeMap.HasMetric(m_SelectedItem))
                    {
                        pane.OpenMetricData(m_SelectedItem, true);
                    }
                    else
                    {
                        pane.ShowAllObjects(m_SelectedItem, true);
                    }
                }
                else if (m_GroupName != null)
                {
                    Treemap.Group group = pane.m_TreeMap.FindGroup(m_GroupName);

                    if (group != null)
                    {
                        pane.OnClickGroup(group);
                    }
                    else
                    {
                        pane.ShowAllObjects(default(Treemap.ObjectMetric), true);
                    }
                }

                pane.m_EventListener.OnRepaint();
            }
Exemple #2
0
        public void ShowAllObjects(Treemap.ObjectMetric itemCopyToSelect, bool focus)
        {
            // TODO: Fix history zooming UX
            focus = false;

            Treemap.ObjectMetric itemToSelect = default(Treemap.ObjectMetric);
            m_TreeMap.ClearMetric();
            if (m_CurrentCodeType == CodeType.Unknown || m_CurrentCodeType == CodeType.Managed)
            {
                var managedObjects = m_UIState.snapshotMode.snapshot.CrawledData.ManagedObjects;
                for (int i = 0; i < managedObjects.Count; ++i)
                {
                    var managedObject = managedObjects[i];
                    if (managedObject.Size > 0)
                    {
                        var o = new Treemap.ObjectMetric(managedObject.ManagedObjectIndex, m_UIState.snapshotMode.snapshot, Treemap.ObjectMetricType.Managed);
                        if (o.Equals(itemCopyToSelect))
                        {
                            itemToSelect = o;
                        }
                        m_TreeMap.AddMetric(o);
                    }
                }
            }
            if (m_CurrentCodeType == CodeType.Unknown || m_CurrentCodeType == CodeType.Native)
            {
                for (int i = 0; i != m_UIState.snapshotMode.snapshot.nativeObjects.Count; ++i)
                {
                    if (m_UIState.snapshotMode.snapshot.nativeObjects.size[i] > 0)
                    {
                        var o = new Treemap.ObjectMetric(i, m_UIState.snapshotMode.snapshot, Treemap.ObjectMetricType.Native);
                        if (o.Equals(itemCopyToSelect))
                        {
                            itemToSelect = o;
                        }
                        m_TreeMap.AddMetric(o);
                    }
                }
            }
            m_TreeMap.UpdateMetric();

            if (!itemToSelect.Equals(default(Treemap.ObjectMetric)))
            {
                OpenMetricData(itemToSelect, focus);
            }
            else
            {
                try
                {
                    var lr = new Database.LinkRequestTable();
                    lr.LinkToOpen           = new Database.TableLink();
                    lr.LinkToOpen.TableName = ObjectAllTable.TableName;
                    lr.SourceTable          = null;
                    lr.SourceColumn         = null;
                    lr.SourceRow            = -1;
                    OpenLinkRequest(lr, false, null, false);
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }