📄 basicinfocontrol.cs
字号:
this.xlblSuperManager.BorderColor = Color.Empty;
this.xlblSuperManager.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblSuperManager.Location = new System.Drawing.Point(2, 0x31);
this.xlblSuperManager.Name = "xlblSuperManager";
this.xlblSuperManager.Size = new Size(0x4f, 13);
this.xlblSuperManager.TabIndex = 1;
this.xlblSuperManager.Text = "超级管理员:";
this.xlblGroupID.set_AutoSize(true);
this.xlblGroupID.BorderColor = Color.Empty;
this.xlblGroupID.ButtonBorderStyle = ButtonBorderStyle.None;
this.xlblGroupID.Location = new System.Drawing.Point(0x1a, 0x15);
this.xlblGroupID.Name = "xlblGroupID";
this.xlblGroupID.Size = new Size(0x37, 13);
this.xlblGroupID.TabIndex = 0;
this.xlblGroupID.Text = "群号码:";
this.xpbProtrait.Anchor = AnchorStyles.None;
this.xpbProtrait.BackColor = Color.Silver;
this.xpbProtrait.Image = (Image) manager.GetObject("xpbProtrait.Image");
this.xpbProtrait.Location = new System.Drawing.Point(0xde, 0x15);
this.xpbProtrait.Name = "xpbProtrait";
this.xpbProtrait.set_Padding(new Padding(1));
this.xpbProtrait.Size = new Size(0x40, 0x40);
this.xpbProtrait.SizeMode = PictureBoxSizeMode.StretchImage;
this.xpbProtrait.TabIndex = 0x10;
this.xpbProtrait.TabStop = false;
this.xpbProtrait.Click += new EventHandler(this.xpbProtrait_Click);
this.gbNickname.Controls.Add(this.xtbGroupNickName);
this.gbNickname.Location = new System.Drawing.Point(3, 0xec);
this.gbNickname.Name = "gbNickname";
this.gbNickname.Size = new Size(0x133, 50);
this.gbNickname.TabIndex = 1;
this.gbNickname.TabStop = false;
this.gbNickname.Text = "群内昵称设置";
this.xtbGroupNickName.BackColor = Color.White;
this.xtbGroupNickName.BorderStyle = BorderStyle.FixedSingle;
this.xtbGroupNickName.EmptyTextTip = "";
this.xtbGroupNickName.EmptyTextTipColor = Color.DarkGray;
this.xtbGroupNickName.Location = new System.Drawing.Point(0x15, 0x16);
this.xtbGroupNickName.MaxLength = 0x40;
this.xtbGroupNickName.Name = "xtbGroupNickName";
this.xtbGroupNickName.Size = new Size(0xfc, 20);
this.xtbGroupNickName.TabIndex = 0;
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
this.BackColor = Color.Transparent;
base.Controls.Add(this.gbNickname);
base.Controls.Add(this.gbBasicInfo);
base.Name = "BasicInfoControl";
base.Size = new Size(0x13a, 290);
this.gbBasicInfo.ResumeLayout(false);
this.gbBasicInfo.PerformLayout();
this.xpbProtrait.EndInit();
this.gbNickname.ResumeLayout(false);
this.gbNickname.PerformLayout();
base.ResumeLayout(false);
}
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
}
private void setContolsEditable()
{
this.xtbGroupID.ReadOnly = true;
this.xtbGroupBulletin.ReadOnly = !base._personalGroup.UserInfo.EnableModifyGroupInfo;
this.xtbGroupName.ReadOnly = !base._personalGroup.UserInfo.EnableModifyGroupInfo;
this.xtbSuperManager.ReadOnly = true;
this.xtbGroupNickName.ReadOnly = !base._personalGroup.UserInfo.EnableModifyMyInfo;
this.xpbProtrait.Enabled = base._personalGroup.UserInfo.EnableModifyGroupInfo;
this.xbtnGroupPortrait.Enabled = base._personalGroup.UserInfo.EnableModifyGroupInfo;
}
private bool show_portraitform()
{
using (GroupPortraitForm form = new GroupPortraitForm(this._framework, ImpsPathInfo.StartupPath + @"\GroupPortraits\", this.CurrentUser.PersistentManager.BaseDirForGroupPortrait, base._personalGroup))
{
if (form.ShowDialog(this) == DialogResult.OK)
{
this.xpbProtrait.Image = form.ResultImg;
return true;
}
return false;
}
}
private void uiData_GroupInfo_Changed(object sender, EventArgs e)
{
UiErrorHelper.HandEventSafely(this._framework, delegate {
base.GroupInfoModified = true;
});
}
private void uiData_Portrait_Changed()
{
UiErrorHelper.HandEventSafely(this._framework, delegate {
base.PortraitModified = true;
});
}
private void uiData_Updated()
{
UiErrorHelper.HandEventSafely(this._framework, delegate {
base.GroupInfoModified = false;
base.UserInfoModified = false;
});
}
private void uiData_UserInfo_Changed(object sender, EventArgs e)
{
UiErrorHelper.HandEventSafely(this._framework, delegate {
base.UserInfoModified = true;
});
}
public override bool UpdateData(bool update)
{
if (update)
{
if (!this.CheckUserInput())
{
return false;
}
try
{
base._personalGroup.GroupInfo.Bulletin.ProposedValue = this.xtbGroupBulletin.Text;
base._personalGroup.GroupInfo.Name.ProposedValue = this.xtbGroupName.Text.Trim();
base._personalGroup.UserInfo.GroupNickName.ProposedValue = this.xtbGroupNickName.Text.Trim();
this.uiData_Updated();
}
catch (Exception exception)
{
this._framework.UnifiedMessageBox.ShowError(this, exception.ToString());
}
}
else
{
try
{
this.handleUiEvent();
this.setContolsEditable();
this.xtbGroupID.Text = base._personalGroup.GroupInfo.Id;
if (((this.CurrentUser.Status == UserAccountStatus.Logon) && (base._personalGroup.MemberLoadStatus == PersonalGroupLoadStatus.None)) && ((((UserIdentity) base._personalGroup.UserInfo.GroupUserIdentity.Value) != UserIdentity.WaitingApprove) && (((UserIdentity) base._personalGroup.UserInfo.GroupUserIdentity.Value) != UserIdentity.Rejct)))
{
AsyncBizOperation op = new AsyncBizOperation();
this.CurrentUser.PersonalGroupManager.GetGroupMemberList(base._personalGroup, op);
base._personalGroup.MemberLoadStatusChanged += new EventHandler<GroupLoadStatusChangedEventArgs>(this, (IntPtr) this._personalGroup_MemberLoadStatusChanged);
}
if (base._personalGroup.SuperManger != null)
{
this.xtbSuperManager.Text = base._personalGroup.SuperManger.DisplayName;
}
this.xtbGroupBulletin.Text = base._personalGroup.GroupInfo.Bulletin.Value;
this.xtbGroupName.Text = base._personalGroup.GroupInfo.Name.Value;
this.xtbGroupNickName.Text = base._personalGroup.UserInfo.GroupNickName.Value;
this.xlblCreateDate.Text = "";
if (base._personalGroup.GroupInfo.CreateDate.get_HasValue())
{
DateTime time = base._personalGroup.GroupInfo.CreateDate.get_Value();
TimeSpan span = (TimeSpan) (DateTime.Now.Date - time.Date);
int totalDays = (int) span.TotalDays;
this.xlblCreateDate.Text = string.Format("创建于{0}年{1}月{2}日,已存在{3}天", new object[] { time.Date.Year.ToString(), time.Date.Month.ToString(), time.Date.Day.ToString(), totalDays.ToString() });
}
this.xpbProtrait.Image = (Image) base._personalGroup.GroupInfo.Portrait;
}
catch (Exception exception2)
{
ClientLogger.WriteException(exception2);
return false;
}
finally
{
base.GroupInfoModified = false;
base.UserInfoModified = false;
}
}
return true;
}
private void xbtnGroupPortrait_Click(object sender, EventArgs e)
{
if (this.show_portraitform())
{
this.uiData_Portrait_Changed();
this._newImage = this.xpbProtrait.Image;
}
}
private void xpbProtrait_Click(object sender, EventArgs e)
{
if (this.show_portraitform())
{
this.uiData_Portrait_Changed();
this._newImage = this.xpbProtrait.Image;
}
}
private Imps.Client.Core.User CurrentUser
{
get
{
return this._framework.AccountManager.CurrentUser;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -