/// <summary> /// Edit an existing spread. /// </summary> private void buttonEdit_Click(object sender, EventArgs e) { DataGridViewSelectedCellCollection selectedCells = dataGridViewSpreadView.SelectedCells; if (selectedCells.Count > 1) { // First get the current spread details. SpreadDetails currentSpreadDetails = ((MutableSpreadDetails)selectedCells[0].OwningRow.DataBoundItem).SpreadDetails; // Make a copy of the spread details so that it can be reverted if necessary. SpreadDetails copyOfSpreadDetails = m_autospreaderManager.GetSpreadDetails(currentSpreadDetails.InstrumentKey); // Create a new spread details form with the spread details copy. SpreadDetailsForm spreadDetailsForm = new SpreadDetailsForm(m_TTAPI.Session, Dispatcher.Current, copyOfSpreadDetails); spreadDetailsForm.ShowDialog(); } }
/// <summary> /// Create a new spread. /// </summary> private void buttonNew_Click(object sender, EventArgs e) { SpreadDetailsForm spreadDetailsForm = new SpreadDetailsForm(m_TTAPI.Session, Dispatcher.Current); spreadDetailsForm.ShowDialog(); }
/// <summary> /// Edit an existing spread. /// </summary> private void buttonEdit_Click(object sender, EventArgs e) { DataGridViewSelectedCellCollection selectedCells = dataGridViewSpreadView.SelectedCells; if (selectedCells.Count > 1) { // First get the current spread details. SpreadDetails currentSpreadDetails = ((MutableSpreadDetails)selectedCells[0].OwningRow.DataBoundItem).SpreadDetails; // Make a copy of the spread details so that it can be reverted if necessary. SpreadDetails copyOfSpreadDetails = m_autospreaderManager.GetSpreadDetails(currentSpreadDetails.InstrumentKey); // Create a new spread details form with the spread details copy. SpreadDetailsForm spreadDetailsForm = new SpreadDetailsForm(m_session, m_dispatcher, copyOfSpreadDetails); spreadDetailsForm.ShowDialog(); } }
/// <summary> /// Create a new spread. /// </summary> private void buttonNew_Click(object sender, EventArgs e) { SpreadDetailsForm spreadDetailsForm = new SpreadDetailsForm(m_session, m_dispatcher); spreadDetailsForm.ShowDialog(); }
/// <summary> /// Create a new spread. /// </summary> private void buttonNew_Click(object sender, EventArgs e) { SpreadDetailsForm spreadDetailsForm = new SpreadDetailsForm(m_TTAPI.Session, Dispatcher.Current); spreadDetailsForm.ShowDialog(); }