Esempio n. 1
0
 public static void Login(Action onLoginSuccess, string serverHost = null, Action btnCloseClick = null)
 {
     if (!RpcRoot.IsLogined)
     {
         var         parent = 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, typeof(LoginWindow), PathPriority.Normal, path: message => {
             window.Vm.LoginName = message.LoginName;
         });
         window.ShowSoftDialog();
         window.PasswordFocus();
     }
     else
     {
         onLoginSuccess?.Invoke();
     }
 }