/// <summary> /// Handles the Click event of the uxReinitialiseEmitter control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void uxReinitialiseEmitter_Click(object sender, EventArgs e) { EmitterTreeNode node = this.uxEffectTree.SelectedNode as EmitterTreeNode; using (NewEmitterDialog dialog = new NewEmitterDialog(node.Emitter.Budget, node.Emitter.Term)) { if (dialog.ShowDialog() == DialogResult.OK) { var args = new EmitterReinitialisedEventArgs(node.Emitter, dialog.EmitterBudget, dialog.EmitterTerm); this.OnEmitterReinitialised(args); } } }
/// <summary> /// Handles the EmitterReinitialised event of the Interface. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ProjectMercury.EffectEditor.EmitterReinitialisedEventArgs"/> instance containing the event data.</param> public void Interface_EmitterReinitialised(object sender, EmitterReinitialisedEventArgs e) { Trace.WriteLine("Reinitialising emitter...", "CORE"); try { e.Emitter.Initialise(e.Budget, e.Term); e.Result = CoreOperationResult.OK; } catch (Exception error) { e.Result = new CoreOperationResult(error); } }
protected virtual void OnEmitterReinitialised(EmitterReinitialisedEventArgs e) { Trace.WriteLine("User requires reinitialising emitter...", "UI"); using (new TraceIndenter()) { Trace.WriteLine("Budget: " + e.Budget); Trace.WriteLine("Term: " + e.Term); } using (new HourglassCursor()) { var handler = Interlocked.CompareExchange(ref this.EmitterReinitialised, null, null); if (handler != null) { handler.Invoke(this, e); } } this.AssertOperationOK(e.Result); }
protected virtual void OnEmitterReinitialised(EmitterReinitialisedEventArgs e) { Trace.WriteLine("User requires reinitialising emitter...", "UI"); using (new TraceIndenter()) { Trace.WriteLine("Budget: " + e.Budget); Trace.WriteLine("Term: " + e.Term); } using (new HourglassCursor()) { var handler = Interlocked.CompareExchange(ref this.EmitterReinitialised, null, null); if (handler != null) handler.Invoke(this, e); } this.AssertOperationOK(e.Result); }
/// <summary> /// Handles the EmitterReinitialised event of the Interface. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ProjectMercury.EffectEditor.EmitterReinitialisedEventArgs"/> instance containing the event data.</param> public void Interface_EmitterReinitialised(Object sender, EmitterReinitialisedEventArgs e) { Trace.WriteLine("Reinitialising emitter...", "CORE"); try { e.Emitter.Initialise(e.Budget, e.Term); e.Result = CoreOperationResult.OK; } catch (Exception error) { e.Result = new CoreOperationResult(error); } }
protected virtual void OnEmitterReinitialised(EmitterReinitialisedEventArgs e) { if (this.EmitterReinitialised != null) this.EmitterReinitialised(this, e); }
/// <summary> /// Handles the EmitterReinitialised event of the Interface. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="ProjectMercury.EffectEditor.EmitterReinitialisedEventArgs"/> instance containing the event data.</param> public void Interface_EmitterReinitialised(object sender, EmitterReinitialisedEventArgs e) { e.Emitter.Initialise(e.Budget, e.Term); }