void SwitchSnapshotMode(UIState.ViewMode mode)
        {
            if (m_UIState.CurrentViewMode == mode)
            {
                return;
            }

            var currentViewName = "Unknown";

            if (currentViewPane is UI.TreeMapPane)
            {
                currentViewName = "TreeMap";
            }
            else if (currentViewPane is UI.MemoryMapPane)
            {
                currentViewName = "MemoryMap";
            }
            else if (currentViewPane is UI.SpreadsheetPane)
            {
                currentViewName = (currentViewPane as UI.SpreadsheetPane).TableDisplayName;
            }
            MemoryProfilerAnalytics.StartEvent <MemoryProfilerAnalytics.DiffToggledEvent>();

            var oldMode = m_UIState.CurrentViewMode;

            m_UIState.CurrentViewMode = mode;

            MemoryProfilerAnalytics.EndEvent(new MemoryProfilerAnalytics.DiffToggledEvent()
            {
                show     = (int)ConvertUIModeToAnalyticsDiffToggleEventData(m_UIState.CurrentViewMode),
                shown    = (int)ConvertUIModeToAnalyticsDiffToggleEventData(oldMode),
                viewName = currentViewName
            });
        }
        void ShowDiffOfOpenSnapshots()
        {
            if (m_UIState.diffMode != null)
            {
                SwitchSnapshotMode(UIState.ViewMode.ShowDiff);
            }
            else if (First != null && Second != null)
            {
                try
                {
                    MemoryProfilerAnalytics.StartEvent <MemoryProfilerAnalytics.DiffedSnapshotEvent>();

                    m_UIState.DiffLastAndCurrentSnapshot(First.GuiData.UtcDateTime.CompareTo(Second.GuiData.UtcDateTime) < 0);

                    MemoryProfilerAnalytics.EndEvent(new MemoryProfilerAnalytics.DiffedSnapshotEvent());
                }
                catch (Exception)
                {
                    throw;
                }
            }
            else
            {
                Debug.LogError("No second snapshot opened to diff to!");
            }
        }