private string BuildStringFor(TestInformationGeneratedMessage message)
 {
     var ret = "";
     ret += message.Item + "\n";
     ret += RecurseElements(0, message.Test);
     return ret;
 }
 public void GenerateAndShowDiagramFor(TestInformationGeneratedMessage message)
 {
     if (frm == null)
     {
         frm = new SequenceDiagram(_mode, _dte, _transparent);
         frm.Closed += frm_Closed;
         frm.WindowState = FormWindowState.Maximized;
     }
     var parent = Control.FromHandle(new IntPtr(_dte.MainWindow.HWnd));
     frm.Parent = parent;
     frm.Location = NativeWinPlacementAPI.GetPlacement(new IntPtr(_dte.MainWindow.HWnd));
     frm.StartPosition = FormStartPosition.CenterScreen;
     frm.CreateDiagramFor(message);
     frm.Show();
     _lastSignature = message.Item;
 }
        public void CreateDiagramFor(TestInformationGeneratedMessage message)
        {
            doc = goView1.Document;
            doc.AllowLink = false;
            doc.AllowEdit = false;
            doc.AllowResize = false;

            RecurseElements(message.Test, null, false, false, false);
            label1.Text = "Sequence diagram for " + message.Item;

            doc.Bounds = doc.ComputeBounds();
            goView1.DocPosition = doc.TopLeft;

            goView1.GridUnboundedSpots = GoObject.BottomLeft | GoObject.BottomRight;
            goView1.Grid.Top = Lifeline.LineStart;
            goView1.GridOriginY = Lifeline.LineStart;
            goView1.GridCellSizeHeight = Lifeline.MessageSpacing;

            // support undo/redo
            doc.UndoManager = new GoUndoManager();
        }
 public void GenerateAndShowDiagramFor(TestInformationGeneratedMessage message)
 {
     var filename = Path.GetTempFileName() + ".diag";
     File.AppendAllText(filename, BuildStringFor(message));
     Open(filename);
 }
 public TestInformationGeneratedMessage GetTestInformationFor(string name)
 {
     var ret = new TestInformationGeneratedMessage(name) {Test = new Chain("GeneratedTest", name)};
     var info = _profilerData.GetTestInformationFor(name);
     if (info == null) return ret;
     foreach(var setup in info.Setups) {ret.Test.Children.Add(BuildChain(setup, true, false, false)); }
     ret.Test.Children.Add(BuildChain(info.TestChain, false, true, false));
     foreach (var teardown in info.Teardowns) { ret.Test.Children.Add(BuildChain(teardown, false, false, true)); }
     return ret;
 }