⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 receiverequestvodafoneform.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 3 页
字号:
            this.panelButton.Name = "panelButton";
            this.panelButton.Size = new Size(0x1b3, 40);
            this.panelButton.TabIndex = 0x1b;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(460, 0x1be);
            base.Controls.Add(this.panelButton);
            base.Controls.Add(this.panelReject);
            base.Controls.Add(this.panelRequest);
            base.Controls.Add(this.panelAlert);
            base.Controls.Add(this.panelLine);
            base.Controls.Add(this.panelContact);
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.Name = "ReceiveRequestVodafoneForm";
            base.Padding = new Padding(6, 0x19, 0x13, 8);
            base.Text = "邀请函";
            base.Load += new EventHandler(this.ReceiveRequestVodafoneForm_Load);
            base.Controls.SetChildIndex(this.panelContact, 0);
            base.Controls.SetChildIndex(this.panelLine, 0);
            base.Controls.SetChildIndex(this.panelAlert, 0);
            base.Controls.SetChildIndex(this.panelRequest, 0);
            base.Controls.SetChildIndex(this.panelReject, 0);
            base.Controls.SetChildIndex(this.panelButton, 0);
            base.Controls.SetChildIndex(base.menubar, 0);
            this.panelContact.ResumeLayout(false);
            this.panelContact.PerformLayout();
            this.panel2.ResumeLayout(false);
            this.panel2.PerformLayout();
            this.panelLine.ResumeLayout(false);
            this.panelLine.PerformLayout();
            this.panelAlert.ResumeLayout(false);
            this.panelAlert.PerformLayout();
            this.panelRequest.ResumeLayout(false);
            this.panelRequest.PerformLayout();
            this.panelReject.ResumeLayout(false);
            this.panelReject.PerformLayout();
            this.panelButton.ResumeLayout(false);
            base.ResumeLayout(false);
        }

        private void initUI()
        {
            this.labelHello.Text = "";
            this.labelNickname.Text = "";
            base.Text = StringTable.FormAddBuddy.RequestReceivedFormTextInit;
            this.radioButtonAgree.Text = StringTable.FormAddBuddy.Agree;
            this.radioButtonReject.Text = StringTable.FormAddBuddy.Reject;
            this.checkBoxBlock.Text = StringTable.FormAddBuddy.Block;
            this.comboBoxGroup.Enabled = false;
            this.checkBoxBlock.Enabled = false;
            this.radioButtonAgree.Checked = true;
            this.comboBoxGroup.Enabled = true;
            this.labelHello.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedFormTextVodafone_Hello, this._contact.Uri.Id);
            this.panelAlert.Visible = !this._isServiceSubscribed;
            this.panelReject.Visible = !this._isServiceSubscribed;
            if (!this._isServiceSubscribed)
            {
                base.Height = 0x1d8;
                this.radioButtonServiceAccept.Checked = true;
            }
            else
            {
                base.Height = 0x1a6;
            }
            this.InitGroup();
            this.setUI();
        }

        private void linkLabelDetail_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                if (MouseButtons.Left == e.Button)
                {
                    this._iFarmeworkWindow.ContactManager.ShowContactDetail(this, this._contact.Uri.Raw);
                }
            }
            catch
            {
            }
        }

        private void linkLabelNewGroup_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            try
            {
                this._iFarmeworkWindow.ContactManager.ShowGroupCreateWindow(this);
            }
            catch
            {
            }
        }

        protected override void OnClosed(EventArgs e)
        {
            try
            {
                this._user.StatusChanged -= new EventHandler<UserSatusChangedEventArgs>(this._user_StatusChanged);
                this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this.contactPersonalInfo_PropertiesChanged);
                this._user.ContactList.ContactGroupChanged -= new EventHandler<ContactGroupChangedEventArgs>(this.ContactList_ContactGroupChanged);
                if ((!this._hasHandleRequest && (this._user.Status != UserAccountStatus.Disconnected)) && ((this._user.Status != UserAccountStatus.Logoff) && (this._user.Status != UserAccountStatus.Logouting)))
                {
                    this._user.ContactList.AsyncHandleContactRequest(this._contact.Uri.ToString(), 2, null, null, false, string.Empty, null);
                    this._hasHandleRequest = true;
                }
            }
            catch
            {
            }
            base.OnClosed(e);
        }

        private void radioButtonAgree_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                this.comboBoxGroup.Enabled = this.radioButtonAgree.Checked;
            }
            catch
            {
            }
        }

        private void radioButtonReject_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                this.checkBoxBlock.Checked = false;
                this.checkBoxBlock.Enabled = this.radioButtonReject.Checked;
            }
            catch
            {
            }
        }

        private void radioButtonServiceAccept_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                this.radioButtonServiceReject.Checked = !this.radioButtonServiceAccept.Checked;
                this.panelRequest.Enabled = this.radioButtonServiceAccept.Checked;
            }
            catch
            {
            }
        }

        private void radioButtonServiceReject_CheckedChanged(object sender, EventArgs e)
        {
            try
            {
                this.radioButtonServiceAccept.Checked = !this.radioButtonServiceReject.Checked;
                this.panelRequest.Enabled = this.radioButtonServiceAccept.Checked;
            }
            catch
            {
            }
        }

        private void ReceiveRequestVodafoneForm_Load(object sender, EventArgs e)
        {
            try
            {
                if (!Imps.Client.Core.FixedClientSetting.Instance.SupportVodafone)
                {
                    base.Close();
                }
                else
                {
                    this.initUI();
                }
            }
            catch
            {
            }
        }

        private void setUI()
        {
            this.pictureBoxPortrait.Image = this._contact.PersonalInfo.PortraitMedium;
            string str = this._contact.PersonalInfo.DisplayName.Replace("&", "&&");
            if (str.Length > 15)
            {
                str = str.Substring(0, 12) + "...";
            }
            base.Text = string.Format(StringTable.FormAddBuddy.RequestReceivedFormTextVodafone, str);
            this.labelNickname.Text = this._contact.PersonalInfo.DisplayName.Replace("&", "&&");
        }

        private void vodafoneServiceSubscribe_Successed(object sender, EventArgs e)
        {
            this._isServiceSubscribed = this._user.IsServiceSubscribed("VodafoneFederation");
            if (this._isServiceSubscribed)
            {
                int? targetGroupId = null;
                if (this.radioButtonAgree.Checked && (this.comboBoxGroup.Items.Count > 0))
                {
                    if ((this.comboBoxGroup.SelectedIndex == -1) || (this.comboBoxGroup.SelectedItem == null))
                    {
                        this._iFarmeworkWindow.UnifiedMessageBox.ShowInfo(StringTable.FormAddBuddy.MustSelectGroup);
                        return;
                    }
                    ComboBoxItem selectedItem = (ComboBoxItem) this.comboBoxGroup.SelectedItem;
                    targetGroupId = new int?((int) selectedItem.Value);
                    if (((int) selectedItem.Value) <= 0)
                    {
                        this._iFarmeworkWindow.UnifiedMessageBox.ShowInfo(StringTable.FormAddBuddy.MustSelectGroup);
                        return;
                    }
                }
                this._hasHandleRequest = true;
                int result = this.radioButtonAgree.Checked ? 1 : 0;
                bool? isBlock = null;
                if (result == 0)
                {
                    isBlock = new bool?(this.checkBoxBlock.Checked);
                }
                AsyncBizOperation op = new AsyncBizOperation();
                this._user.ContactList.AsyncHandleContactRequest(this._contact.Uri.Raw, result, isBlock, targetGroupId, false, string.Empty, op);
                if (this.checkBoxBlock.Checked)
                {
                    this._user.ContactList.AsyncAddToBlackList(this._contact.Uri, op);
                }
                base.Close();
            }
            else
            {
                this._iFarmeworkWindow.UnifiedMessageBox.ShowError(StringTable.Services.VodafoneSubscribeFailed);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -