private void Host_Operate(object sender, OperatorEventArgs e) { if (this.InvokeRequired) { this.Invoke(new OperationEventHandler(this.InvokeOperate), sender, e); } else { this.InvokeOperate(sender, e); } }
private void InvokeOperate(object sender, OperatorEventArgs e) { try { switch (e.Type) { case OperationTypes.Play: if (File.Exists(e.Resource.FullName) == false) { return; } this.ReadytoPlay(e.Resource); ((IOperate)this.player).Play(e.Resource); break; case OperationTypes.Stop: this.DisposePlayer(); break; } } catch (Exception ex) { } }
/// <summary> /// The current information of the operator this machines trades under. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void onGotOperator(object sender, OperatorEventArgs e) { WriteToConsole("onGotOperator: " + e.Name); }