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

📄 sendrequestform.cs

📁 破解的飞信源代码
💻 CS
📖 第 1 页 / 共 5 页
字号:
            }
            else
            {
                if (e.Type == ContactGroupEventType.ContactCountChanged)
                {
                    return;
                }
                ContactGroupEventType type = e.Type;
            }
            this.initGroup();
            this.initGroupVodafone();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void findContactByMobileNoVodafone()
        {
        }

        private void findContactByMobileOrSid(bool isMobileNo)
        {
            IicUri uri;
            Imps.Client.Core.Contact contact;
            this.LastContact = null;
            AsyncBizOperation op = new AsyncBizOperation();
            op.IsImpsErrorHandled = true;
            if (isMobileNo)
            {
                if (this.textBoxMobileNo.Text.Length != 11)
                {
                    return;
                }
                if (!ImpsHelper.IsCmccMobileNo(this.textBoxMobileNo.Text))
                {
                    this._frameworkWindow.UnifiedMessageBox.ShowWarning(this, StringTable.Contact.InvalidMobileNo);
                    return;
                }
                uri = IicUri.CreateTelUri(this.textBoxMobileNo.Text.Trim());
                contact = this._user.ContactList.FindContactByMsisdnEx(uri.MobileNo);
                if (contact == null)
                {
                    contact = this._user.ContactList.FindOrCreateContact(uri.Raw, op);
                }
            }
            else
            {
                if (this.textBoxSID.Text.Length < 3)
                {
                    return;
                }
                long sid = Convert.ToInt64(this.textBoxSID.Text.Trim());
                uri = IicUri.CreateSidUri(sid);
                contact = this._user.ContactList.FindContact(uri.Raw);
                if (contact == null)
                {
                    this._user.ContactList.AsyncGetUri(sid, op);
                    op.Successed += new EventHandler(this.op_GetUriSuccessed);
                }
            }
            if (contact != null)
            {
                this.LastContact = contact;
            }
        }

        private void findContactBySidVodafone()
        {
        }

        private static string getStr(string source, int len)
        {
            string text = source;
            int num = 0;
            int length = 0;
            for (int i = 0; i < text.Length; i++)
            {
                if (Regex.IsMatch(text.Substring(i, 1), @"[\u4e00-\u9fa5]+"))
                {
                    num += 2;
                }
                else
                {
                    num++;
                }
                if (num <= len)
                {
                    length++;
                }
                if (num >= len)
                {
                    return text.Substring(0, length);
                }
            }
            return text;
        }

        private void initGroup()
        {
            this.comboBoxGroup.DropDownStyle = ComboBoxStyle.DropDownList;
            this.comboBoxGroup.Items.Clear();
            lock (this._user.ContactList.Groups.SyncRoot)
            {
                using (IEnumerator<ContactGroupBase> enumerator = this._user.ContactList.Groups.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        Imps.Client.Core.ContactGroup group = (Imps.Client.Core.ContactGroup) enumerator.get_Current();
                        if (group.Id != -1)
                        {
                            ComboBoxItem item = new ComboBoxItem(group.Name, group.Id);
                            this.comboBoxGroup.Items.Add(item);
                            if (this._initTargetGroupId.get_HasValue())
                            {
                                int? nullable = this._initTargetGroupId;
                                if ((nullable.GetValueOrDefault() == group.Id) && nullable.get_HasValue())
                                {
                                    this.comboBoxGroup.SelectedItem = item;
                                }
                            }
                        }
                    }
                }
            }
            if (this._initTargetGroupId.get_HasValue())
            {
                int? nullable2 = this._initTargetGroupId;
                if (!((nullable2.GetValueOrDefault() == -1) && nullable2.get_HasValue()))
                {
                    return;
                }
            }
            if (this.comboBoxGroup.Items.Count > 0)
            {
                this.comboBoxGroup.SelectedIndex = 0;
            }
        }

        private void initGroupVodafone()
        {
            if (Imps.Client.Core.FixedClientSetting.Instance.SupportVodafone && this._user.IsServiceSubscribed("VodafoneFederation"))
            {
                this.comboBoxGroupV.DropDownStyle = ComboBoxStyle.DropDownList;
                this.comboBoxGroupV.Items.Clear();
                lock (this._user.ContactList.Groups.SyncRoot)
                {
                    using (IEnumerator<ContactGroupBase> enumerator = this._user.ContactList.Groups.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            Imps.Client.Core.ContactGroup group = (Imps.Client.Core.ContactGroup) enumerator.get_Current();
                            if (group.Id != -1)
                            {
                                ComboBoxItem item = new ComboBoxItem(group.Name, group.Id);
                                this.comboBoxGroupV.Items.Add(item);
                                if (this._initTargetGroupIdV.get_HasValue())
                                {
                                    int? nullable = this._initTargetGroupIdV;
                                    if ((nullable.GetValueOrDefault() == group.Id) && nullable.get_HasValue())
                                    {
                                        this.comboBoxGroupV.SelectedItem = item;
                                    }
                                }
                            }
                        }
                    }
                }
                if (this._initTargetGroupIdV.get_HasValue())
                {
                    int? nullable2 = this._initTargetGroupIdV;
                    if (!((nullable2.GetValueOrDefault() == -1) && nullable2.get_HasValue()))
                    {
                        return;
                    }
                }
                if (this.comboBoxGroup.Items.Count > 0)
                {
                    this.comboBoxGroupV.SelectedIndex = 0;
                }
            }
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(SendRequestForm));
            this.labelAlert = new XLabel();
            this.radioButtonMobileNo = new RadioButton();
            this.lbIAm = new XLabel();
            this.textBoxMobileNo = new XTextBox();
            this.radioButtonSID = new RadioButton();
            this.textBoxSID = new XTextBox();
            this.linkLabelMobileNoHint = new LinkLabel();
            this.textBoxMyName = new XTextBox();
            this.comboBoxGroup = new XComboBox();
            this.buttonOK = new XButton();
            this.buttonCancel = new XButton();
            this.panel1 = new Panel();
            this.panelAddBuddy = new Panel();
            this.tabControlAddBuddy = new XTabControl();
            this.tabPageImps = new XTabPage();
            this.groupBox1 = new GroupBox();
            this.xTextBoxNickname = new XTextBox();
            this.linkLabelNewGroup = new UButton();
            this.label4 = new Label();
            this.linkLabelDetail = new LinkLabel();
            this.label3 = new Label();
            this.groupBoxPreview = new GroupBox();
            this.label15 = new XLabel();
            this.tabPageVodafone = new XTabPage();
            this.xTextBoxNicknameV = new XTextBox();
            this.linkLabelNicknameSIDV = new LinkLabel();
            this.linkLabelNicknameMobileNoV = new LinkLabel();
            this.linkLabelNewGroupV = new LinkLabel();
            this.comboBoxGroupV = new XComboBox();
            this.label5 = new XLabel();
            this.xTextBoxMobileNoV = new XTextBox();
            this.radioButtonMobileNoV = new RadioButton();
            this.xTextBoxSIDV = new XTextBox();
            this.radioButtonSIDV = new RadioButton();
            this.panelTop = new Panel();
            XLabel label = new XLabel();
            XLabel label2 = new XLabel();
            XLabel label3 = new XLabel();
            XLabel label4 = new XLabel();
            XLabel label5 = new XLabel();
            XLabel label6 = new XLabel();
            this.panel1.SuspendLayout();
            this.panelAddBuddy.SuspendLayout();
            this.tabControlAddBuddy.SuspendLayout();
            this.tabPageImps.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.groupBoxPreview.SuspendLayout();
            this.tabPageVodafone.SuspendLayout();
            base.SuspendLayout();
            label.set_AutoSize(true);
            label.BackColor = Color.Transparent;
            label.BorderColor = Color.Empty;
            label.ButtonBorderStyle = ButtonBorderStyle.None;
            label.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
            label.ForeColor = SystemColors.ControlText;
            label.Location = new System.Drawing.Point(90, 0xa8);
            label.Name = "label14";
            label.Size = new Size(0x67, 15);
            label.TabIndex = 0x1f;
            label.Text = "请设置对方的昵称";
            label.UseMnemonic = false;
            label2.set_AutoSize(true);
            label2.BackColor = Color.Transparent;
            label2.BorderColor = Color.Empty;
            label2.ButtonBorderStyle = ButtonBorderStyle.None;
            label2.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
            label2.ForeColor = Color.RoyalBlue;
            label2.Location = new System.Drawing.Point(5, 130);

⌨️ 快捷键说明

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