示例#1
0
 /// <summary>
 /// 解析连接开启
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Parsing_CheckedChanged(object sender, EventArgs e)
 {
     if (ClassStatic.GetConfigSoftware("parse") != Parsing.Checked.ToString())
     {
         ClassStatic.SetConfigSoftware("parse", Parsing.Checked.ToString());
         Action <bool, byte[]>  action     = new Action <bool, byte[]>(SettingChange_Callback);
         ClassStatic.ClientData clientData = new ClassStatic.ClientData("parse", Parsing.Checked.ToString());
         ClassStatic.tcpClient.Send(220, ClassStatic.SetClientDataByte(clientData), action);
     }
 }
示例#2
0
        /// <summary>
        /// 快捷键设置抬起
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TextShortcutKey_KeyUp(object sender, KeyEventArgs e)
        {
            TextBox that = sender as TextBox;
            string  type;

            if (that.Tag != null)
            {
                if (that == textCopy)
                {
                    type = "copy";
                }
                else if (that == textPaste)
                {
                    type = "paste";
                }
                else if (that == textScreenshot)
                {
                    type = "screenshot";
                }
                else if (that == textColor)
                {
                    type = "color";
                }
                else
                {
                    type = "";
                }

                if (that.Text != "" && that.Text != that.Tag.ToString())
                {
                    if (type != "")
                    {
                        Action <bool, byte[]>  action     = new Action <bool, byte[]>(SettingChange_Callback);
                        ClassStatic.ClientData clientData = new ClassStatic.ClientData(type, that.Text);
                        ClassStatic.tcpClient.Send(220, ClassStatic.SetClientDataByte(clientData), action);
                        ClassStatic.SetConfigSoftware(type, that.Text);
                    }
                }
                else
                {
                    that.Text = that.Tag.ToString();
                }
                that.Tag = null;
                if (shortcutkey)
                {
                    shortcutkey = false;
                    FormMain.formMain.ShortcutkeyHandRegister();
                }
            }
        }
        /// <summary>
        /// 登录成功,加载数据
        /// </summary>
        /// <param name="phone"></param>
        public void LoginSuccess(string phone)
        {
            this.Invoke(new Action(() => {
                timerControlLoading.Start();
                if (!ClassStatic.IsPhone(phone))
                {
                    LabelTipShow("登录失败,登录账号格式有误", true);
                    return;
                }
                ClassStatic.account = phone;

                string name = Dns.GetHostName();
                string mac  = ClassStatic.GetMacByNetworkInterface();
                Action <bool, byte[]> action      = new Action <bool, byte[]>(SendMyOnline_Callback);
                ClassStatic.ClientData clientData = new ClassStatic.ClientData(name, mac, ClassStatic.portraitPid.ToString());
                ClassStatic.tcpClient.Send(201, ClassStatic.SetClientDataByte(clientData), action);
            }));
        }