Beispiel #1
0
        //发送
        private void btnSend_Click(object sender, EventArgs e)
        {
            if (this.globalUserCache.GetGroup(currentGroup.ID).NoSpeakList != null)
            {
                if (this.globalUserCache.GetGroup(currentGroup.ID).NoSpeakList.Contains(this.mine.UserID))

                {
                    this.AppendSysMessage("您已经被禁言!");
                    return;
                }
            }



            ChatBoxContent content = this.chatBoxSend.GetContent();

            if (content.IsEmpty())
            {
                return;
            }

            try
            {
                byte[] buff      = CompactPropertySerializer.Default.Serialize(content);
                byte[] encrypted = buff;
                if (GlobalResourceManager.Des3Encryption != null)
                {
                    encrypted = GlobalResourceManager.Des3Encryption.Encrypt(buff);
                }

                ++this.sendingCount;
                this.gifBox_wait.Visible = true;
                UIResultHandler handler = new UIResultHandler(this, this.HandleSentResult);
                this.rapidPassiveEngine.ContactsOutter.BroadcastBlob(this.currentGroup.GroupID, BroadcastTypes.BroadcastChat, encrypted, null, 2048, handler.Create(), null);

                this.AppendChatBoxContent(string.Format("{0}({1})", this.mine.Name, this.mine.UserID), null, content, Color.Green);
                ChatMessageRecord record = new ChatMessageRecord(this.mine.UserID, this.currentGroup.GroupID, buff, true, false);
                GlobalResourceManager.ChatMessageRecordPersister.InsertChatMessageRecord(record);



                //清空输入框
                this.chatBoxSend.Text = string.Empty;
                this.chatBoxSend.Focus();

                if (this.LastWordChanged != null)
                {
                    LastWordsRecord lastWordsRecord = new LastWordsRecord(this.mine.ID, this.mine.Name, true, content);
                    this.LastWordChanged(true, this.currentGroup.GroupID, lastWordsRecord);
                }
            }
            catch
            {
                this.AppendSysMessage("发送消息失败!");
            }
        }
        private void btnRegister_Click(object sender, EventArgs e)
        {
            try
            {
                //0923
                if (!this.rapidPassiveEngine.Connected)
                {
                    this.toolTip1.Show("离线状态,无法修改资料。", this.btnRegister, new Point(this.btnRegister.Width / 2, -this.btnRegister.Height), 3000);
                    return;
                }


                if (this.skinTextBox_nickName.SkinTxt.Text.Trim().Length == 0)
                {
                    MessageBoxEx.Show("群名称不能为空!");
                    return;
                }



                this.currentGroup.Name     = this.skinTextBox_nickName.SkinTxt.Text;
                this.currentGroup.Announce = this.skinTextBox_signature.SkinTxt.Text;


                //0923
                this.Cursor = Cursors.WaitCursor;
                UIResultHandler handler = new UIResultHandler(this, this.UpdateCallback);
                byte[]          data    = ESPlus.Serialization.CompactPropertySerializer.Default.Serialize(this.currentGroup);
                //回复异步调用,避免阻塞UI线程
                this.rapidPassiveEngine.SendMessage(null, InformationTypes.UpdateGroupInfo, data, null, 2048, handler.Create(), null); //0924
            }
            catch (Exception ee)
            {
                this.Cursor = Cursors.Default;
                this.toolTip1.Show("修改失败!" + ee.Message, this.btnRegister, new Point(this.btnRegister.Width / 2, -this.btnRegister.Height), 3000);
            }
        }
Beispiel #3
0
        private void btnRegister_Click(object sender, EventArgs e)
        {
            try
            {
                //0923
                if (!this.rapidPassiveEngine.Connected)
                {
                    this.toolTip1.Show("离线状态,无法修改资料。", this.btnRegister, new Point(this.btnRegister.Width / 2, -this.btnRegister.Height), 3000);
                    return;
                }

                this.currentUser.HeadImageIndex = this.headImageIndex;
                this.currentUser.Name           = this.skinTextBox_nickName.SkinTxt.Text;
                this.currentUser.Signature      = this.skinTextBox_signature.SkinTxt.Text;
                if (this.selfPhoto)
                {
                    this.currentUser.HeadImageData  = ESBasic.Helpers.ImageHelper.Convert(this.pnlImgTx.BackgroundImage);
                    this.currentUser.HeadImageIndex = -1;
                }
                else
                {
                    this.currentUser.HeadImageData = null;
                }

                //0923
                this.Cursor = Cursors.WaitCursor;
                UIResultHandler handler = new UIResultHandler(this, this.UpdateCallback);
                byte[]          data    = ESPlus.Serialization.CompactPropertySerializer.Default.Serialize(this.currentUser);
                //回复异步调用,避免阻塞UI线程
                this.rapidPassiveEngine.SendMessage(null, InformationTypes.UpdateUserInfo, data, null, 2048, handler.Create(), null); //0924
            }
            catch (Exception ee)
            {
                this.Cursor = Cursors.Default;
                this.toolTip1.Show("修改失败!" + ee.Message, this.btnRegister, new Point(this.btnRegister.Width / 2, -this.btnRegister.Height), 3000);
            }
        }
        private void btnRegister_Click(object sender, EventArgs e)
        {
            try
            {
                //0923
                if (!this.rapidPassiveEngine.Connected)
                {
                    this.toolTip1.Show("离线状态,无法修改资料。", this.btnRegister, new Point(this.btnRegister.Width / 2, -this.btnRegister.Height), 3000);
                    return;
                }

                this.currentUser.HeadImageIndex = this.headImageIndex;
                this.currentUser.Name = this.skinTextBox_nickName.SkinTxt.Text;
                this.currentUser.Signature = this.skinTextBox_signature.SkinTxt.Text;               
                if (this.selfPhoto)
                {
                    this.currentUser.HeadImageData = ESBasic.Helpers.ImageHelper.Convert(this.pnlImgTx.BackgroundImage);
                    this.currentUser.HeadImageIndex = -1;
                }
                else
                {
                    this.currentUser.HeadImageData = null;
                }

                //0923
                this.Cursor = Cursors.WaitCursor;
                UIResultHandler handler = new UIResultHandler(this, this.UpdateCallback);
                byte[] data = ESPlus.Serialization.CompactPropertySerializer.Default.Serialize(this.currentUser);
                //回复异步调用,避免阻塞UI线程
                this.rapidPassiveEngine.SendMessage(null, InformationTypes.UpdateUserInfo, data, null, 2048, handler.Create(), null); //0924               
            }
            catch (Exception ee)
            {
                this.Cursor = Cursors.Default;
                this.toolTip1.Show("修改失败!" + ee.Message, this.btnRegister, new Point(this.btnRegister.Width / 2, -this.btnRegister.Height), 3000);   
            }

        }