📄 pgcreategroupcontrol.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client.Core;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using Imps.Client.Pc.Utils;
using Imps.Client.Resource;
using Imps.Client.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class PGCreateGroupControl : UserControl
{
private IFrameworkWindow _iFrameworkWnd;
private CheckBox chkSearchable;
private IContainer components;
private GroupBox gbBasicInfo;
private GroupBox gbGroupIntroduction;
private GroupBox gbJoinMethod;
private Label lblKey;
private RadioButton rdbNeedAuthorize;
private RadioButton rdbPermitAll;
private RadioButton rdbRejectAll;
private Imps.Client.Pc.GroupCategory ucGroupCategory;
private XButton xbtnGroupPortrait;
private XLabel xlblGroupCategory;
private XLabel xlblGroupName;
private DisplayPortrait xpbProtrait;
private XTextBox xtxtGroupIntroduction;
private XTextBox xtxtGroupName;
public PGCreateGroupControl(IFrameworkWindow wnd)
{
this._iFrameworkWnd = wnd;
this.InitializeComponent();
this.ucGroupCategory.Categorys = this.CurrentUser.PersonalGroupManager.GroupCategory.Categorys;
this.xtxtGroupName.Focus();
this.xpbProtrait.Image = ImpsPortrait.GetDefaultGroupPortrait(0x60, 0x60);
}
private bool CheckGroupInput()
{
string text = this.xtxtGroupName.Text.Trim();
if (text.Length <= 0)
{
BalloonHelper.ShowInputErrorBallon(this.xtxtGroupName, StringTable.CreatePersonalGroup.MsgGroupNameNotEmpty, StringTable.Options.TitleInvalidInput);
return false;
}
int num = 0x40;
if (text.Length > num)
{
BalloonHelper.ShowInputErrorBallon(this.xtxtGroupName, string.Format(StringTable.CreatePersonalGroup.MsgGroupNameTooLong, num), StringTable.Options.TitleInvalidInput);
return false;
}
return true;
}
public bool CollectData(PersonalGroupInfo info)
{
try
{
PersonalGroupValidateType needValidate;
if (!this.CheckGroupInput())
{
return false;
}
info.Name.ProposedValue = this.xtxtGroupName.Text.Trim();
info.Introduce.ProposedValue = this.xtxtGroupIntroduction.Text.Trim();
info.Category.ProposedValue = this.ucGroupCategory.Value;
info.EnableSearched.ProposedValue = this.chkSearchable.Checked;
if (this.rdbNeedAuthorize.Checked)
{
needValidate = PersonalGroupValidateType.NeedValidate;
}
else if (this.rdbPermitAll.Checked)
{
needValidate = PersonalGroupValidateType.AllAgree;
}
else
{
needValidate = PersonalGroupValidateType.AllRejct;
}
info.ValidateType.ProposedValue = needValidate;
info.Portrait.ProposedValue = this.xpbProtrait.Image;
return true;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
return false;
}
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void InitializeComponent()
{
ComponentResourceManager manager = new ComponentResourceManager(typeof(PGCreateGroupControl));
this.gbBasicInfo = new GroupBox();
this.lblKey = new Label();
this.xpbProtrait = new DisplayPortrait();
this.xbtnGroupPortrait = new XButton();
this.ucGroupCategory = new Imps.Client.Pc.GroupCategory();
this.xtxtGroupName = new XTextBox();
this.xlblGroupCategory = new XLabel();
this.xlblGroupName = new XLabel();
this.chkSearchable = new CheckBox();
this.gbGroupIntroduction = new GroupBox();
this.xtxtGroupIntroduction = new XTextBox();
this.gbJoinMethod = new GroupBox();
this.rdbRejectAll = new RadioButton();
this.rdbPermitAll = new RadioButton();
this.rdbNeedAuthorize = new RadioButton();
this.gbBasicInfo.SuspendLayout();
this.gbGroupIntroduction.SuspendLayout();
this.gbJoinMethod.SuspendLayout();
base.SuspendLayout();
this.gbBasicInfo.Controls.Add(this.lblKey);
this.gbBasicInfo.Controls.Add(this.xpbProtrait);
this.gbBasicInfo.Controls.Add(this.xbtnGroupPortrait);
this.gbBasicInfo.Controls.Add(this.ucGroupCategory);
this.gbBasicInfo.Controls.Add(this.xtxtGroupName);
this.gbBasicInfo.Controls.Add(this.xlblGroupCategory);
this.gbBasicInfo.Controls.Add(this.xlblGroupName);
this.gbBasicInfo.Dock = DockStyle.Top;
this.gbBasicInfo.Location = new System.Drawing.Point(9, 3);
this.gbBasicInfo.Name = "gbBasicInfo";
this.gbBasicInfo.Size = new Size(380, 0x9a);
this.gbBasicInfo.TabIndex = 1;
this.gbBasicInfo.TabStop = false;
this.gbBasicInfo.Text = "基本信息";
this.lblKey.set_AutoSize(true);
this.lblKey.Font = new Font("Microsoft Sans Serif", 12f, FontStyle.Regular, GraphicsUnit.Point, 0);
this.lblKey.ForeColor = Color.Red;
this.lblKey.Location = new System.Drawing.Point(0xdf, 40);
this.lblKey.Name = "lblKey";
this.lblKey.Size = new Size(15, 20);
this.lblKey.TabIndex = 15;
this.lblKey.Text = "*";
this.xpbProtrait.Anchor = AnchorStyles.None;
this.xpbProtrait.BackColor = Color.White;
this.xpbProtrait.BorderColor = Color.FromArgb(0xa4, 170, 220);
this.xpbProtrait.Image = (Image) manager.GetObject("xpbProtrait.Image");
this.xpbProtrait.Location = new System.Drawing.Point(0x10c, 13);
this.xpbProtrait.Name = "xpbProtrait";
this.xpbProtrait.ShowSecondBorder = false;
this.xpbProtrait.Size = new Size(0x66, 0x66);
this.xpbProtrait.TabIndex = 14;
this.xpbProtrait.ToolTipText = "";
this.xpbProtrait.Click += new EventHandler(this.xpbProtrait_Click);
this.xbtnGroupPortrait.AutoArrangementX = true;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -