📄 sendrequestform.cs
字号:
{
contact = this._user.ContactList.FindOrCreateContact(uri.Raw, op, false);
}
}
else
{
if (this.textBoxSID.Text.Length < 7)
{
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.AsyncGetContactInfoBySid(sid, out contact, op, null);
}
}
if (contact != null)
{
this.LastContact = contact;
this._user.ContactList.AsyncGetContactsInfo(contact, op, null, true, new string[] { "nickname", "provisioning", "portrait-crc" });
}
}
private void findContactBySidVodafone()
{
}
private static string getStr(string source, int len)
{
string str = source;
int num = 0;
int length = 0;
for (int i = 0; i < str.Length; i++)
{
if (Regex.IsMatch(str.Substring(i, 1), @"[\u4e00-\u9fa5]+"))
{
num += 2;
}
else
{
num++;
}
if (num <= len)
{
length++;
}
if (num >= len)
{
return str.Substring(0, length);
}
}
return str;
}
private void initGroup()
{
this.comboBoxGroup.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBoxGroup.Items.Clear();
lock (this._user.ContactList.Groups.SyncRoot)
{
foreach (Imps.Client.Core.ContactGroup group in this._user.ContactList.Groups)
{
if (group.Id != -1)
{
ComboBoxItem item = new ComboBoxItem(group.Name, group.Id);
this.comboBoxGroup.Items.Add(item);
if (this._initTargetGroupId.HasValue && (this._initTargetGroupId == group.Id))
{
this.comboBoxGroup.SelectedItem = item;
}
}
}
}
if ((!this._initTargetGroupId.HasValue || (this._initTargetGroupId == -1)) && (this.comboBoxGroup.Items.Count > 0))
{
this.comboBoxGroup.SelectedIndex = 0;
}
}
private void initGroupVodafone()
{
this.comboBoxGroupV.DropDownStyle = ComboBoxStyle.DropDownList;
this.comboBoxGroupV.Items.Clear();
lock (this._user.ContactList.Groups.SyncRoot)
{
foreach (Imps.Client.Core.ContactGroup group in this._user.ContactList.Groups)
{
if (group.Id != -1)
{
ComboBoxItem item = new ComboBoxItem(group.Name, group.Id);
this.comboBoxGroupV.Items.Add(item);
if (this._initTargetGroupIdV.HasValue && (this._initTargetGroupIdV == group.Id))
{
this.comboBoxGroupV.SelectedItem = item;
}
}
}
}
if ((!this._initTargetGroupIdV.HasValue || (this._initTargetGroupIdV == -1)) && (this.comboBoxGroup.Items.Count > 0))
{
this.comboBoxGroupV.SelectedIndex = 0;
}
}
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(SendRequestForm));
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.label1 = new Label();
this.panel1 = new Panel();
this.panelAddBuddy = new Panel();
this.tabControlAddBuddy = new XTabControl();
this.tabPageImps = new XTabPage();
this.labelSetNickname = new XLabel();
this.label3 = new XLabel();
this.linkLabelDetail = new LinkLabel();
this.xTextBoxNickname = new XTextBox();
this.labelAlert = new XLabel();
this.pictureBoxPortrait = new DisplayPortrait();
this.groupBoxPreview = new GroupBox();
this.label15 = new XLabel();
this.labelPreview = new XLabel();
this.linkLabelNewGroup = new LinkLabel();
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();
XLabel label7 = new XLabel();
XLabel label8 = new XLabel();
XLabel label9 = new XLabel();
XLabel label10 = new XLabel();
XLabel label11 = new XLabel();
this.panel1.SuspendLayout();
this.panelAddBuddy.SuspendLayout();
this.tabControlAddBuddy.SuspendLayout();
this.tabPageImps.SuspendLayout();
this.groupBoxPreview.SuspendLayout();
this.tabPageVodafone.SuspendLayout();
base.SuspendLayout();
base.menubar.Location = new Point(3, 0x21);
label.AutoEllipsis = false;
label.AutoSize = true;
label.BackColor = Color.Transparent;
label.BorderColor = Color.Black;
label.BorderStyle = BorderStyle.None;
label.ButtonBorderStyle = ButtonBorderStyle.Solid;
label.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
label.ForeColor = Color.RoyalBlue;
label.Location = new Point(5, 0xd7);
label.Name = "label4";
label.Size = new Size(0x4a, 15);
label.TabIndex = 0x19;
label.Text = "对方的资料";
label.TextAlign = ContentAlignment.TopLeft;
label.UseMnemonic = false;
label2.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
label2.AutoEllipsis = false;
label2.BorderColor = Color.Black;
label2.BorderStyle = BorderStyle.Fixed3D;
label2.ButtonBorderStyle = ButtonBorderStyle.Solid;
label2.Location = new Point(80, 0xdf);
label2.Name = "label11";
label2.Size = new Size(450, 2);
label2.TabIndex = 0x1a;
label2.Text = "label11";
label2.TextAlign = ContentAlignment.TopLeft;
label2.UseMnemonic = false;
label3.AutoEllipsis = false;
label3.AutoSize = true;
label3.BackColor = Color.Transparent;
label3.BorderColor = Color.Black;
label3.BorderStyle = BorderStyle.None;
label3.ButtonBorderStyle = ButtonBorderStyle.Solid;
label3.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Bold, GraphicsUnit.Point, 0);
label3.ForeColor = Color.RoyalBlue;
label3.Location = new Point(5, 14);
label3.Name = "label9";
label3.Size = new Size(0x73, 15);
label3.TabIndex = 0x13;
label3.Text = "将对方添加为好友";
label3.TextAlign = ContentAlignment.TopLeft;
label3.UseMnemonic = false;
label4.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top;
label4.AutoEllipsis = false;
label4.BorderColor = Color.Black;
label4.BorderStyle = BorderStyle.Fixed3D;
label4.ButtonBorderStyle = ButtonBorderStyle.Solid;
label4.Location = new Point(0x76, 0x17);
label4.Name = "label10";
label4.Size = new Size(400, 2);
label4.TabIndex = 20;
label4.Text = "label10";
label4.TextAlign = ContentAlignment.TopLeft;
label4.UseMnemonic = false;
label5.AutoEllipsis = false;
label5.AutoSize = true;
label5.BackColor = Color.Transparent;
label5.BorderColor = Color.Black;
label5.BorderStyle = BorderStyle.None;
label5.ButtonBorderStyle = ButtonBorderStyle.Solid;
label5.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
label5.ForeColor = SystemColors.ControlText;
label5.Location = new Point(0x127, 0x110);
label5.Name = "label6";
label5.Size = new Size(0x58, 15);
label5.TabIndex = 12;
label5.Text = "将对方添加到";
label5.TextAlign = ContentAlignment.TopLeft;
label5.UseMnemonic = false;
label6.AutoEllipsis = false;
label6.AutoSize = true;
label6.BackColor = Color.Transparent;
label6.BorderColor = Color.Black;
label6.BorderStyle = BorderStyle.None;
label6.ButtonBorderStyle = ButtonBorderStyle.Solid;
label6.Font = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
label6.ForeColor = SystemColors.ControlText;
label6.Location = new Point(90, 0xa8);
label6.Name = "label14";
label6.Size = new Size(0x73, 15);
label6.TabIndex = 0x1f;
label6.Text = "请设置对方的昵称";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -