Example #1
0
 public void ChangeMachineName(string newName, string oldName)
 {
     if (newName == oldName)
     {
         return;
     }
     ///
     if (string.IsNullOrEmpty(newName))
     {
         ErrorDialogCon errorcon = new ErrorDialogCon();
         errorcon.ErrorMsg = "名称不能为空";
         errorcon.PopupDialog();
         return;
     }
     ///
     if (MachineLogic.ChangeMachineName(MachineLogic.localMachine().machineId, newName) == false)
     {
         ErrorDialogCon errorcon = new ErrorDialogCon();
         errorcon.ErrorMsg = "更新名称错误";
         errorcon.PopupDialog();
         return;
     }
     ///
     foreach (var m in myMachines)
     {
         WebSocketClient.SendMessage(m.machineId, newName, msgType.client_onNameChange);
     }
 }
Example #2
0
        protected void showInfo(string info)
        {
            ErrorDialogCon con = new ErrorDialogCon();

            con.ErrorMsg = info;
            con.PopupDialog();
        }
Example #3
0
        private void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            e.Handled = true;
            ErrorDialogCon con = new ErrorDialogCon();

            con.ErrorMsg = e.Exception.Message;
            //show the dialog
            con.PopupDialog();
        }
Example #4
0
 public void checkMethod(object param)
 {
     if (UserLogic.checkRegisterUser(checkId, checkCode) == true)
     {
         ErrorDialogCon con = new ErrorDialogCon();
         con.ErrorMsg = "注册成功,请登录";
         //show the dialog
         con.PopupDialog();
         NavigationHelper.NavigatedToView("用户登录");
     }
 }
 public void loginMethod(object param)
 {
     if (UserLogic.Login(this.userName, pwd, Environment.MachineName))
     {
         var            machineInfo = MachineLogic.localMachine();
         ErrorDialogCon con         = new ErrorDialogCon();
         con.ErrorMsg = "登录成功,机器ID:" + machineInfo.machineId + ",机器密码:" + machineInfo.machinepwd;
         //show the dialog
         con.PopupDialog();
         NavigationHelper.NavigatedToView("主界面");
     }
 }
Example #6
0
        public void onRecive_AnswerRequestConnect(websocketMsgTemp <object> e)
        {
            string remoteMachineId = e.sendMachineId;
            var    isAgree         = bool.Parse(e.content.ToString());

            if (isAgree == false)
            {
                Application.Current.Dispatcher.Invoke(() =>
                {
                    ErrorDialogCon con = new ErrorDialogCon();
                    con.ErrorMsg       = "对方不同意链接";
                    DialogHost.Show(con);
                });
                return;
            }
            this.ControllerLogic.ConnectMachine(remoteMachineId);
        }
Example #7
0
        public void onClientNotOnLine(websocketMsgTemp <LYLUserMachineInfo> data)
        {
            ErrorDialogCon con = new ErrorDialogCon();

            con.ErrorMsg = "用户不在线,消息发送失败";
        }