private void headingCol_OnDeleteClick(object sender, EventArgs e) { VisualSession[] sessions = new VisualSession[selectedSessions.Keys.Count]; selectedSessions.Keys.CopyTo(sessions, 0); selectedSessions.Clear(); DeleteSessions(sessions); }
protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e.Button != MouseButtons.Left) { return; } VisualSession session = GetVisualSessionAtCoordinates(e.X, e.Y); if (session == null) { return; } if (!selectedSessions.ContainsKey(session)) { selectedSessions[session] = true; } else { selectedSessions.Remove(session); } headingBitmap = GetHeadingBitmap(); Invalidate(); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { NewVisualizationForm frm = new NewVisualizationForm(); if (frm.ShowDialog(this) == DialogResult.OK) { multiStreamView.Visible = false; multiStreamView.Clear(); List <VisualSession> visSessions = new List <VisualSession>(sessions.Length); List <VisualTransaction> transactions = new List <VisualTransaction>(); foreach (IPSession session in sessions) { foreach (SessionVisualizer vis in frm.GetSelectedVisualizers()) { transactions.AddRange(vis.GetTransactions(session)); } if (transactions.Count > 0) { VisualSession vs = new VisualSession(session); transactions.AddRange(StreamVisualizationManager.TCPEventsVis.GetTransactions(session)); vs.Transactions.AddRange(transactions); vs.TransactionsCreated(); visSessions.Add(vs); transactions.Clear(); } } foreach (VisualSession session in visSessions) { session.SessionsCreated(); } multiStreamView.Sessions = visSessions.ToArray(); multiStreamView.Visible = true; multiStreamView.Focus(); exportToXMLToolStripMenuItem.Enabled = (visSessions.Count > 0); submitToRepositoryToolStripMenuItem.Enabled = (visSessions.Count > 0); } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button != MouseButtons.Right) { return; } ctxMenuCurSession = GetVisualSessionAtCoordinates(e.X, e.Y); if (ctxMenuCurSession == null) { return; } ContextMenuStrip menu = new ContextMenuStrip(); ToolStripItem item = new ToolStripMenuItem("Delete selected", null, new EventHandler(headingCol_OnDeleteClick)); menu.Items.Add(item); item.Enabled = (selectedSessions.Count > 0); menu.Show(this, e.X, e.Y); }
private void newToolStripMenuItem_Click(object sender, EventArgs e) { NewVisualizationForm frm = new NewVisualizationForm(); if (frm.ShowDialog(this) == DialogResult.OK) { multiStreamView.Visible = false; multiStreamView.Clear(); List<VisualSession> visSessions = new List<VisualSession>(sessions.Length); List<VisualTransaction> transactions = new List<VisualTransaction>(); foreach (IPSession session in sessions) { foreach (SessionVisualizer vis in frm.GetSelectedVisualizers()) { transactions.AddRange(vis.GetTransactions(session)); } if (transactions.Count > 0) { VisualSession vs = new VisualSession(session); transactions.AddRange(StreamVisualizationManager.TCPEventsVis.GetTransactions(session)); vs.Transactions.AddRange(transactions); vs.TransactionsCreated(); visSessions.Add(vs); transactions.Clear(); } } foreach (VisualSession session in visSessions) { session.SessionsCreated(); } multiStreamView.Sessions = visSessions.ToArray(); multiStreamView.Visible = true; multiStreamView.Focus(); exportToXMLToolStripMenuItem.Enabled = (visSessions.Count > 0); submitToRepositoryToolStripMenuItem.Enabled = (visSessions.Count > 0); } }
protected override void OnMouseUp(MouseEventArgs e) { base.OnMouseUp(e); if (e.Button != MouseButtons.Right) return; ctxMenuCurSession = GetVisualSessionAtCoordinates(e.X, e.Y); if (ctxMenuCurSession == null) return; ContextMenuStrip menu = new ContextMenuStrip(); ToolStripItem item = new ToolStripMenuItem("Delete selected", null, new EventHandler(headingCol_OnDeleteClick)); menu.Items.Add(item); item.Enabled = (selectedSessions.Count > 0); menu.Show(this, e.X, e.Y); }
public void DeleteSessions(VisualSession[] sessions, bool update) { foreach (VisualSession session in sessions) { foreach (VisualTransaction transaction in session.Transactions) { transaction.Parent = null; //transaction.Left = 0; //transaction.Top = 0; //transaction.SizeChanged -= transactionSizeChangedHandler; //transaction.DoubleClick -= transactionDoubleClickHandler; } this.sessions.Remove(session); } if (update) { UpdateView(); EmitSessionsChanged(); } }
public void DeleteSessions(VisualSession[] sessions) { DeleteSessions(sessions, true); }
public void AddSessions(VisualSession[] sessions, bool update) { this.sessions.AddRange(sessions); EmitSessionsChanged(); foreach (VisualSession session in sessions) { foreach (VisualTransaction transaction in session.Transactions) { transaction.Parent = null; transaction.Left = 0; transaction.Top = 0; transaction.SizeChanged += transactionSizeChangedHandler; transaction.DoubleClick += transactionDoubleClickHandler; } } if (update) { UpdateView(); EmitSessionsChanged(); } }
public void AddSessions(VisualSession[] sessions) { AddSessions(sessions, true); }