HeapProfiler.DiffViewer.LoadRange C# (CSharp) Method

LoadRange() public method

public LoadRange ( Pair range ) : IEnumerator
range Pair
return IEnumerator
        public IEnumerator<object> LoadRange(Pair<int> range)
        {
            PendingLoadPair = range;

            LoadingPanel.Text = "Generating diff...";
            LoadingProgress.Value = 0;
            LoadingProgress.Style = ProgressBarStyle.Marquee;

            MainMenuStrip.Enabled = false;
            LoadingPanel.Visible = true;
            MainSplit.Visible = false;
            UseWaitCursor = true;

            var s1 = Instance.Snapshots[range.First];
            var s2 = Instance.Snapshots[range.Second];

            Timeline.Selection = range;

            var f = Start(Instance.DiffSnapshots(s1, s2));
            using (f)
                yield return f;

            var filename = f.Result as string;
            if (filename != null) {
                f = Start(LoadDiff(filename));
                using (f)
                    yield return f;
            } else {
                DiffLoaded(f.Result as HeapDiff, "unknown");
            }

            PendingLoadPair = Pair.New(-1, -1);
            CurrentPair = range;

            Text = "Diff Viewer - " + String.Format("{0} - {1}", s1.Timestamp.ToLongTimeString(), s2.Timestamp.ToLongTimeString());
        }

Usage Example

示例#1
0
        protected void ShowDiff(int index1, int index2)
        {
            var viewer = new DiffViewer(Scheduler, Instance);

            viewer.Start(viewer.LoadRange(Pair.New(index1, index2)));

            viewer.Show(this);
        }
All Usage Examples Of HeapProfiler.DiffViewer::LoadRange