Beispiel #1
0
 public AllocationForm(Diff diff, int startWidth)
     : this()
 {
     Diff = diff;
     RenderManager.Rebuild(Diff.Difference, startWidth);
     SetupScroller(new History(diff.Difference));
 }
Beispiel #2
0
 internal void RemoveDiff(Diff diff)
 {
     Diffs.Remove(diff);
 }
Beispiel #3
0
        void MainScrubber_DoubleClick(object sender, EventArgs e)
        {
            // React to double click based on current diff state
            if (CurrentDiff == null || CurrentDiff.Difference != null)
            {
                // Start a new diff
                CurrentDiff = new Diff();
                CurrentDiff.SetLeft(TransportForm.Profile.History.Snapshot);
                TransportForm.AllocationForm.DiffMarkers.SetDiff1((float)TransportForm.AllocationForm.MainScrubber._Position);
            }
            else if (CurrentDiff.Difference == null)
            {
                // Complete the diff
                CurrentDiff.SetRight(TransportForm.Profile.History.Snapshot);
                TransportForm.AllocationForm.DiffMarkers.SetDiff2((float)TransportForm.AllocationForm.MainScrubber._Position);
                AddDiffTab(CurrentDiff);

                // TODO: Remove diff on tab close
                TransportForm.Profile.AddDiff(CurrentDiff);

                if (Licensing.IsTrial && !SentDiffNag)
                {
                    MessagesForm.Add(MessagesForm.MessageType.Info, null,
                                    "Find your leak? Support Alloclave and purchase a license!");

                    SentDiffNag = true;
                }
            }
        }
Beispiel #4
0
 internal void AddDiff(Diff diff)
 {
     Diffs.Add(diff);
 }
Beispiel #5
0
 private void AddDiffTab(Diff diff)
 {
     AllocationForm allocationForm = new AllocationForm(diff, TransportForm.AllocationForm.AddressSpaceControl.Width);
     allocationForm.Text = "Diff";
     allocationForm.ControllerContainer.Controls.Remove(allocationForm.MainScrubber);
     DiffButtons diffButtons = new DiffButtons();
     diffButtons.StartLabel.Click += (_, __) => allocationForm.SetDiffMode(AllocationForm.DiffMode.Left);
     diffButtons.DifferenceLabel.Click += (_, __) => allocationForm.SetDiffMode(AllocationForm.DiffMode.Middle);
     diffButtons.EndLabel.Click += (_, __) => allocationForm.SetDiffMode(AllocationForm.DiffMode.Right);
     allocationForm.ControllerContainer.Controls.Add(diffButtons);
     allocationForm.AddressSpaceControl.SnapshotOverride = diff.Difference;
     TransportForm.AddTab(allocationForm);
 }