void ResetCanvas() { if (m_canvasWindow.InvokeRequired) { m_canvasWindow.Invoke(new Action(ResetCanvas)); } else { m_canvasWindow.GetPicture().ClearAll(); selectedLayerID = Gui_CreateLayer(); // Gui_ClearSelectedLayer(); } }
public void OnJsonArrived(JToken pJson) { if (m_canvasWindow.InvokeRequired) { m_canvasWindow.Invoke(new AsyncTcpClient.JsonHandler(OnJsonArrived), pJson); } else { string func = pJson.Value <string>("func"); switch (func) { case "credentials": my_room = pJson.Value <string>("room"); my_name = pJson.Value <string>("user"); break; case "user_quit": RemoveUser(pJson.Value <string>("user")); break; case "user_join": AddUser(pJson.Value <string>("user")); break; default: Execute(pJson.Value <string>("user"), pJson); break; } } }