private void OnSignout(object _item) { try { RobotInstance.instance.autoReconnect = true; RobotInstance.instance.Projects.Clear(); var ld = DManager.Layout.Descendents().OfType <LayoutDocument>().ToList(); foreach (var document in ld) { if (document.Content is Views.WFDesigner view) { document.Close(); } } Config.Reload(); Config.local.password = new byte[] { }; Config.local.jwt = new byte[] { }; global.webSocketClient.url = Config.local.wsurl; _ = global.webSocketClient.Close(); } catch (Exception ex) { Log.Error(ex, ""); MessageBox.Show(ex.Message); } }
private void OnSignout(object _item) { try { var ld = DManager.Layout.Descendents().OfType <LayoutDocument>().ToList(); foreach (var document in ld) { if (document.Content is Views.WFDesigner view) { document.Close(); } } Config.Reload(); Config.local.password = new byte[] { }; Config.local.jwt = new byte[] { }; global.webSocketClient.url = Config.local.wsurl; global.webSocketClient.user = null; _ = global.webSocketClient.Close(); } catch (Exception ex) { Log.Error(ex.ToString()); MessageBox.Show(ex.Message); } }