📄 applyforjoinform.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.Resource;
using Imps.Client.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class ApplyForJoinForm : XIMDialog
{
private string _applyNote;
private AsyncBizOperation _bz;
private IFrameworkWindow _framework;
public PersonalGroup _personalgroup;
private bool _seeDetail;
private IContainer components;
private Label lblGroupId;
private Label lblGroupName;
private Panel pnlApplyNote;
private Panel pnlContent;
private UPanel pnlGroupInfo;
private Panel pnlPortrait;
private XButton xbtnCancel;
private XButton xbtnOK;
private XLabel xlblApplyNote;
private XLabel xlblAttention;
private XLabel xlblCatagory;
private XLabel xlblCatagoryTag;
private XLabel xlblGroupID;
private XLabel xlblGroupIntroduce;
private XLabel xlblGroupName;
private XLabel xlblMemberCountTag;
private XLabel xlblMembersCount;
private XPictureBox xpbPortrait;
private XTextBox xtbApplyNote;
private XTextBox xtbIntroduce;
public ApplyForJoinForm(IFrameworkWindow framework, PersonalGroup pg, bool seeDetail)
{
this._framework = framework;
this._personalgroup = pg;
this.InitializeComponent();
base.Controls.SetChildIndex(this.pnlContent, 0);
base.ShowInTaskbar = false;
this._bz = new AsyncBizOperation();
this._seeDetail = seeDetail;
this.xpbPortrait.Image = ImpsPortrait.GetDefaultGroupPortrait(0x60, 0x60);
this._personalgroup.GroupInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.GroupInfo_PropertiesChanged);
this.UpdateGroupInfo(seeDetail);
this.CurrentUser.StatusChanged += new EventHandler<UserSatusChangedEventArgs>(this, (IntPtr) this.CurrentUser_StatusChanged);
}
private void ApplyForJoinForm_Activated(object sender, EventArgs e)
{
if (this._seeDetail)
{
this.xbtnCancel.Focus();
}
else
{
this.xtbApplyNote.Focus();
}
}
private void ApplyForJoinForm_FormClosing(object sender, FormClosingEventArgs e)
{
this._personalgroup.GroupInfo.PropertiesChanged -= new EventHandler<PropertiesChangedEventArgs>(this, (IntPtr) this.GroupInfo_PropertiesChanged);
}
private void CurrentUser_StatusChanged(object sender, UserSatusChangedEventArgs e)
{
try
{
if (e.NewStatus != UserAccountStatus.Logon)
{
base.Close();
}
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private string getCategoryString(string categoryID)
{
Dictionary<PersonalGroupCategory.Category, List<PersonalGroupCategory.Category>>.KeyCollection.Enumerator enumerator = this.CurrentUser.PersonalGroupManager.GroupCategory.Categorys.get_Keys().GetEnumerator();
try
{
while (enumerator.MoveNext())
{
PersonalGroupCategory.Category category = enumerator.get_Current();
if (category.Id == categoryID)
{
return category.Name;
}
List<PersonalGroupCategory.Category>.Enumerator enumerator2 = this.CurrentUser.PersonalGroupManager.GroupCategory.Categorys.get_Item(category).GetEnumerator();
try
{
while (enumerator2.MoveNext())
{
PersonalGroupCategory.Category category2 = enumerator2.get_Current();
if (category2.Id == categoryID)
{
return string.Format("{0}/{1}", category.Name, category2.Name);
}
}
continue;
}
finally
{
enumerator2.Dispose();
}
}
}
finally
{
enumerator.Dispose();
}
return string.Empty;
}
private void GroupInfo_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
try
{
this.xpbPortrait.Image = (Image) this._personalgroup.GroupInfo.Portrait;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
}
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(ApplyForJoinForm));
this.pnlContent = new Panel();
this.pnlApplyNote = new Panel();
this.xlblApplyNote = new XLabel();
this.xtbApplyNote = new XTextBox();
this.xlblAttention = new XLabel();
this.pnlGroupInfo = new UPanel();
this.xlblCatagory = new XLabel();
this.xlblMembersCount = new XLabel();
this.xlblMemberCountTag = new XLabel();
this.xlblCatagoryTag = new XLabel();
this.xlblGroupIntroduce = new XLabel();
this.xlblGroupName = new XLabel();
this.lblGroupName = new Label();
this.xtbIntroduce = new XTextBox();
this.lblGroupId = new Label();
this.pnlPortrait = new Panel();
this.xpbPortrait = new XPictureBox();
this.xlblGroupID = new XLabel();
this.xbtnOK = new XButton();
this.xbtnCancel = new XButton();
this.pnlContent.SuspendLayout();
this.pnlApplyNote.SuspendLayout();
this.pnlGroupInfo.SuspendLayout();
this.pnlPortrait.SuspendLayout();
base.SuspendLayout();
this.pnlContent.BackColor = Color.Transparent;
this.pnlContent.Controls.Add(this.pnlApplyNote);
this.pnlContent.Controls.Add(this.xlblAttention);
this.pnlContent.Controls.Add(this.pnlGroupInfo);
this.pnlContent.Location = new System.Drawing.Point(9, 0x11);
this.pnlContent.Name = "pnlContent";
this.pnlContent.set_Padding(new Padding(3));
this.pnlContent.Size = new Size(0x16d, 0x134);
this.pnlContent.TabIndex = 4;
this.pnlApplyNote.BackColor = Color.Transparent;
this.pnlApplyNote.Controls.Add(this.xlblApplyNote);
this.pnlApplyNote.Controls.Add(this.xtbApplyNote);
this.pnlApplyNote.Location = new System.Drawing.Point(1, 0xd4);
this.pnlApplyNote.Name = "pnlApplyNote";
this.pnlApplyNote.Size = new Size(0x16c, 90);
this.pnlApplyNote.TabIndex = 4;
this.xlblApplyNote.set_AutoSize(true);
this.xlblApplyNote.BorderColor = Color.Empty;
this.xlblApplyNote.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblApplyNote.Location = new System.Drawing.Point(7, 9);
this.xlblApplyNote.Name = "xlblApplyNote";
this.xlblApplyNote.Size = new Size(0x43, 13);
this.xlblApplyNote.TabIndex = 0;
this.xlblApplyNote.Text = "申请说明:";
this.xtbApplyNote.BackColor = Color.White;
this.xtbApplyNote.BorderStyle = BorderStyle.FixedSingle;
this.xtbApplyNote.EmptyTextTip = "";
this.xtbApplyNote.EmptyTextTipColor = Color.DarkGray;
this.xtbApplyNote.Location = new System.Drawing.Point(6, 0x1d);
this.xtbApplyNote.MaxLength = 0x80;
this.xtbApplyNote.Multiline = true;
this.xtbApplyNote.Name = "xtbApplyNote";
this.xtbApplyNote.ScrollBars = ScrollBars.Vertical;
this.xtbApplyNote.Size = new Size(350, 0x37);
this.xtbApplyNote.TabIndex = 0;
this.xlblAttention.set_AutoSize(true);
this.xlblAttention.BorderColor = Color.Empty;
this.xlblAttention.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblAttention.ForeColor = Color.MidnightBlue;
this.xlblAttention.Location = new System.Drawing.Point(3, 10);
this.xlblAttention.Name = "xlblAttention";
this.xlblAttention.Size = new Size(0x1f, 13);
this.xlblAttention.TabIndex = 0;
this.xlblAttention.Text = "注:";
this.pnlGroupInfo.BorderColor = Color.Silver;
this.pnlGroupInfo.BorderInsideColor = Color.Transparent;
this.pnlGroupInfo.BorderInsideWidth = 0;
this.pnlGroupInfo.BorderWidth = 1;
this.pnlGroupInfo.Controls.Add(this.xlblCatagory);
this.pnlGroupInfo.Controls.Add(this.xlblMembersCount);
this.pnlGroupInfo.Controls.Add(this.xlblMemberCountTag);
this.pnlGroupInfo.Controls.Add(this.xlblCatagoryTag);
this.pnlGroupInfo.Controls.Add(this.xlblGroupIntroduce);
this.pnlGroupInfo.Controls.Add(this.xlblGroupName);
this.pnlGroupInfo.Controls.Add(this.lblGroupName);
this.pnlGroupInfo.Controls.Add(this.xtbIntroduce);
this.pnlGroupInfo.Controls.Add(this.lblGroupId);
this.pnlGroupInfo.Controls.Add(this.pnlPortrait);
this.pnlGroupInfo.Controls.Add(this.xlblGroupID);
this.pnlGroupInfo.Location = new System.Drawing.Point(6, 0x1f);
this.pnlGroupInfo.Name = "pnlGroupInfo";
this.pnlGroupInfo.Size = new Size(350, 0xaf);
this.pnlGroupInfo.TabIndex = 7;
this.xlblCatagory.set_AutoEllipsis(true);
this.xlblCatagory.BorderColor = Color.Empty;
this.xlblCatagory.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblCatagory.Location = new System.Drawing.Point(0x8a, 0x38);
this.xlblCatagory.Name = "xlblCatagory";
this.xlblCatagory.Size = new Size(0xc7, 13);
this.xlblCatagory.TabIndex = 11;
this.xlblCatagory.Text = "默认分类";
this.xlblMembersCount.set_AutoEllipsis(true);
this.xlblMembersCount.BorderColor = Color.Empty;
this.xlblMembersCount.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblMembersCount.Location = new System.Drawing.Point(0x8a, 0x4f);
this.xlblMembersCount.Name = "xlblMembersCount";
this.xlblMembersCount.Size = new Size(0xc7, 13);
this.xlblMembersCount.TabIndex = 10;
this.xlblMembersCount.Text = "0";
this.xlblMemberCountTag.set_AutoSize(true);
this.xlblMemberCountTag.BorderColor = Color.Empty;
this.xlblMemberCountTag.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblMemberCountTag.Location = new System.Drawing.Point(0x55, 0x4f);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -