📄 applyjoingroupform.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client;
using Imps.Client.Core;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using Imps.Client.Utils;
using Imps.Common;
using Imps.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class ApplyJoinGroupForm : XIMDialog
{
private Contact _contact;
private string _description;
private IFrameworkWindow _framework;
private PersonalGroup _group;
private IContainer components;
private GroupBox gbReply;
private AsyncBizOperation op;
private PictureBox pbPortrait;
private Panel pnlContent;
private RadioButton rbAgree;
private RadioButton rbReject;
private XButton xbtnCancel;
private XButton xbtnOK;
private HtmlLabel xlblAnouce;
private XLabel xlblUserName;
private XLinkLabel xlblUserNameText;
private XTextBox xtbApplyNote;
public ApplyJoinGroupForm(IFrameworkWindow wnd, Contact contact, string contactNickname, PersonalGroup group, string description)
{
string source;
this._framework = wnd;
this._contact = contact;
this._description = description;
this._group = group;
this.InitializeComponent();
this.pbPortrait.Image = this._contact.PersonalInfo.Portrait;
this.xtbApplyNote.Text = this._description;
if (contact is Stranger)
{
source = StringHelper.GetPaddingStringEndEllipsis(contactNickname, 11);
this.xlblUserNameText.Text = contactNickname;
}
else
{
source = StringHelper.GetPaddingStringEndEllipsis(this._contact.PersonalInfo.DisplayName, 11);
this.xlblUserNameText.Text = this._contact.DisplayName;
}
string paddingStringEndEllipsis = StringHelper.GetPaddingStringEndEllipsis(this._group.GroupInfo.Name.Value, 11);
source = StringHelper.EncodString(source);
paddingStringEndEllipsis = StringHelper.EncodString(paddingStringEndEllipsis);
string text3 = string.Format("<a href='{0}'>{1}({2})</a>", this._contact.Uri.Raw, source, this._contact.Uri.Id);
string text4 = string.Format("<a href='{0}'>{1}({2})</a>", this._group.Uri.Raw, paddingStringEndEllipsis, this._group.Uri.Id);
this.xlblAnouce.Text = string.Format("飞信用户{0}申请加入群{1},请求您通过身份验证。", text3, text4);
this.xlblAnouce.LabelLinkClick += new EventHandler<LabelLinkClickEventArgs>(this, (IntPtr) this.xlblAnouce_LabelLinkClick);
this.initComponentRegion();
}
private void ApplyJoinGroupForm_FormClosing(object sender, FormClosingEventArgs e)
{
this._contact.PersonalInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.PersonalInfo_PropertiesChanged);
this.xlblAnouce.LabelLinkClick -= new EventHandler<LabelLinkClickEventArgs>(this, (IntPtr) this.xlblAnouce_LabelLinkClick);
}
private void ApplyJoinGroupForm_Load(object sender, EventArgs e)
{
this._contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.PersonalInfo_PropertiesChanged);
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
this.xbtnCancel = new XButton();
this.xbtnOK = new XButton();
this.pnlContent = new Panel();
this.xlblAnouce = new HtmlLabel();
this.gbReply = new GroupBox();
this.rbReject = new RadioButton();
this.rbAgree = new RadioButton();
this.xtbApplyNote = new XTextBox();
this.xlblUserNameText = new XLinkLabel();
this.xlblUserName = new XLabel();
this.pbPortrait = new PictureBox();
this.pnlContent.SuspendLayout();
this.gbReply.SuspendLayout();
this.pbPortrait.BeginInit();
base.SuspendLayout();
this.xbtnCancel.AutoArrangementX = false;
this.xbtnCancel.AutoSizeToImage = false;
this.xbtnCancel.BackColor = Color.Transparent;
this.xbtnCancel.BackgroundImageDisable = null;
this.xbtnCancel.BackgroundImageDown = null;
this.xbtnCancel.BackgroundImageHover = null;
this.xbtnCancel.ChangeSkin = true;
this.xbtnCancel.DialogResult = DialogResult.Cancel;
this.xbtnCancel.Location = new System.Drawing.Point(0x106, 0xfd);
this.xbtnCancel.Name = "xbtnCancel";
this.xbtnCancel.Size = new Size(0x4b, 0x19);
this.xbtnCancel.TabIndex = 1;
this.xbtnCancel.Text = "取消";
this.xbtnCancel.set_UseVisualStyleBackColor(false);
this.xbtnCancel.Click += new EventHandler(this.xbtnCancel_Click);
this.xbtnOK.AutoArrangementX = false;
this.xbtnOK.AutoSizeToImage = false;
this.xbtnOK.BackColor = Color.Transparent;
this.xbtnOK.BackgroundImageDisable = null;
this.xbtnOK.BackgroundImageDown = null;
this.xbtnOK.BackgroundImageHover = null;
this.xbtnOK.ChangeSkin = true;
this.xbtnOK.Location = new System.Drawing.Point(0xb5, 0xfd);
this.xbtnOK.Name = "xbtnOK";
this.xbtnOK.Size = new Size(0x4b, 0x19);
this.xbtnOK.TabIndex = 0;
this.xbtnOK.Text = "确定";
this.xbtnOK.set_UseVisualStyleBackColor(false);
this.xbtnOK.Click += new EventHandler(this.xbtnOK_Click);
this.pnlContent.BackColor = Color.Transparent;
this.pnlContent.Controls.Add(this.xlblAnouce);
this.pnlContent.Controls.Add(this.gbReply);
this.pnlContent.Controls.Add(this.xtbApplyNote);
this.pnlContent.Controls.Add(this.xlblUserNameText);
this.pnlContent.Controls.Add(this.xlblUserName);
this.pnlContent.Controls.Add(this.pbPortrait);
this.pnlContent.ForeColor = SystemColors.ControlText;
this.pnlContent.Location = new System.Drawing.Point(0x12, 11);
this.pnlContent.Name = "pnlContent";
this.pnlContent.Size = new Size(0x14d, 0xde);
this.pnlContent.TabIndex = 2;
this.xlblAnouce.set_AutoEllipsis(true);
this.xlblAnouce.LinkColor = Color.Blue;
this.xlblAnouce.Location = new System.Drawing.Point(9, 6);
this.xlblAnouce.Name = "xlblAnouce";
this.xlblAnouce.ShowBackgroundImage = false;
this.xlblAnouce.Size = new Size(0x133, 0x27);
this.xlblAnouce.SpaceDistance = 5;
this.xlblAnouce.TabIndex = 11;
this.xlblAnouce.Text = "飞信用户xxxx昵称(12345678)申请加入群xxxx群名(12345678),请求您通过身份验证。";
this.xlblAnouce.TextAlign = ContentAlignment.MiddleLeft;
this.gbReply.Controls.Add(this.rbReject);
this.gbReply.Controls.Add(this.rbAgree);
this.gbReply.Location = new System.Drawing.Point(12, 140);
this.gbReply.Name = "gbReply";
this.gbReply.Size = new Size(0x133, 0x45);
this.gbReply.TabIndex = 10;
this.gbReply.TabStop = false;
this.gbReply.Text = "回应";
this.rbReject.set_AutoSize(true);
this.rbReject.Location = new System.Drawing.Point(0x10, 0x2a);
this.rbReject.Name = "rbReject";
this.rbReject.Size = new Size(0x31, 0x11);
this.rbReject.TabIndex = 1;
this.rbReject.Text = "拒绝";
this.rbReject.set_UseVisualStyleBackColor(true);
this.rbAgree.set_AutoSize(true);
this.rbAgree.Checked = true;
this.rbAgree.Location = new System.Drawing.Point(0x10, 0x13);
this.rbAgree.Name = "rbAgree";
this.rbAgree.Size = new Size(0x31, 0x11);
this.rbAgree.TabIndex = 0;
this.rbAgree.TabStop = true;
this.rbAgree.Text = "同意";
this.rbAgree.set_UseVisualStyleBackColor(true);
this.xtbApplyNote.BackColor = Color.FromArgb(240, 240, 240);
this.xtbApplyNote.BorderStyle = BorderStyle.None;
this.xtbApplyNote.EmptyTextTip = "";
this.xtbApplyNote.EmptyTextTipColor = Color.LightGray;
this.xtbApplyNote.Location = new System.Drawing.Point(0x6c, 0x4c);
this.xtbApplyNote.Multiline = true;
this.xtbApplyNote.Name = "xtbApplyNote";
this.xtbApplyNote.ReadOnly = true;
this.xtbApplyNote.ScrollBars = ScrollBars.Vertical;
this.xtbApplyNote.Size = new Size(0xd3, 0x39);
this.xtbApplyNote.TabIndex = 9;
this.xlblUserNameText.AutoEllipsis = true;
this.xlblUserNameText.BorderColor = Color.Empty;
this.xlblUserNameText.BorderStyle = BorderStyle.None;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -