/// <summary> /// Destroy the static refrence and close all connections. /// </summary> /// <param name="refrenceID"></param> public static void DestroyStaticRefrenceById(string refrenceID) { if (!sm_StaticRefrences.ContainsKey(refrenceID)) { return; } CSCom com = sm_StaticRefrences[refrenceID]; sm_StaticRefrences.Remove(refrenceID); // send the destroy command. if (com.IsAlive) { com.Send(NPMessage.FromValue(null, NPMessageType.Destroy, "C# static refrence destoryed.")); com.Stop(); } }
private void SendErrorMessage(string id, Exception ex) { MessageRecived(this, new WebsocketPipe <NPMessage> .MessageEventArgs(NPMessage.FromValue(ex.ToString(), NPMessageType.Error, ex.ToString()), false, id)); }