protected virtual void OnTeleportStatusChanged(TeleportStatusEventArgs e) { if (TeleportStatusChanged != null) TeleportStatusChanged(this, e); }
private void Self_OnTeleport(string message, AgentManager.TeleportStatus status, AgentManager.TeleportFlags flags) { if (status == AgentManager.TeleportStatus.Finished || status == AgentManager.TeleportStatus.Failed) teleporting = false; TeleportStatusEventArgs ea = new TeleportStatusEventArgs(message, status, flags); if (netcomSync != null) netcomSync.BeginInvoke(new OnTeleportStatusRaise(OnTeleportStatusChanged), new object[] { ea }); else OnTeleportStatusChanged(ea); }
private void netcom_TeleportStatusChanged(object sender, TeleportStatusEventArgs e) { switch (e.Status) { case AgentManager.TeleportStatus.Start: case AgentManager.TeleportStatus.Progress: lblTeleportStatus.Text = e.Message; break; case AgentManager.TeleportStatus.Failed: RefreshControls(); MessageBox.Show(e.Message, "Teleport", MessageBoxButtons.OK, MessageBoxIcon.Error); break; case AgentManager.TeleportStatus.Finished: this.Close(); break; } }