public static void Login(Action onLoginSuccess, string serverHost = null, Action btnCloseClick = null) { if (!RpcRoot.IsLogined) { var parent = WpfUtil.GetTopWindow(); LoginWindow window = new LoginWindow(onLoginSuccess, serverHost, btnCloseClick); if (parent != null && parent.GetType() != typeof(NotiCenterWindow)) { window.Owner = parent; window.WindowStartupLocation = WindowStartupLocation.CenterOwner; window.ShowInTaskbar = false; } window.ShowSoftDialog(); window.PasswordFocus(); } else { onLoginSuccess?.Invoke(); } }
public static void Login(Action onLoginSuccess) { if (!IsLogined()) { UIThread.Execute(() => () => { var topWindow = WpfUtil.GetTopWindow(); LoginWindow window = new LoginWindow(onLoginSuccess); if (topWindow != null && topWindow.GetType() != typeof(NotiCenterWindow)) { window.Owner = topWindow; window.WindowStartupLocation = WindowStartupLocation.CenterOwner; } window.ShowSoftDialog(); window.PasswordFocus(); }); } else { onLoginSuccess?.Invoke(); } }
public static void Login(Action onLoginSuccess, string serverHost = null, Action btnCloseClick = null) { if (!RpcRoot.IsLogined) { var parent = WpfUtil.GetTopWindow(); LoginWindow window = new LoginWindow(onLoginSuccess, serverHost, btnCloseClick); if (parent != null && parent.GetType() != typeof(NotiCenterWindow)) { window.Owner = parent; window.WindowStartupLocation = WindowStartupLocation.CenterOwner; window.ShowInTaskbar = false; } window.BuildEventPath <SignUpedEvent>("注册了新外网群控用户后自动填入外网群控用户名", LogEnum.None, path: message => { window.Vm.LoginName = message.LoginName; }, typeof(LoginWindow)); window.ShowSoftDialog(); window.PasswordFocus(); } else { onLoginSuccess?.Invoke(); } }