?? pspermissioncontrol.cs
字號:
this.xcbIvrElse.Size = new Size(0xd6, 0x15);
this.xcbIvrElse.TabIndex = 11;
this.xcbIvrElse.Visible = false;
this.xcbIvrElse.MouseHover += new EventHandler(this.xcbIvrElse_MouseHover);
this.xcbIvrElse.DropDown += new EventHandler(this.xcbIvr_DropDown);
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.Controls.Add(this.xcbIvrElse);
base.Controls.Add(this.xcbIvrBuddy);
base.Controls.Add(this.tvElse);
base.Controls.Add(this.lbOthers);
base.Controls.Add(label);
base.Controls.Add(this.cbStrangerBlock);
base.Controls.Add(this.rbRejectAll);
base.Controls.Add(this.rbNeedApply);
base.Controls.Add(this.rbAgreeAll);
base.Controls.Add(this.lbAddBuddyTip);
base.Controls.Add(this.lbBasic);
base.Controls.Add(label2);
base.Name = "PsPermissionControl";
base.Size = new Size(0x16b, 0x1b1);
base.DoubleClick += new EventHandler(this.PsPermissionControl_DoubleClick);
base.Load += new EventHandler(this.PsPermissionControl_Load);
base.ResumeLayout(false);
base.PerformLayout();
}
private void initIvrBuddyComboBox()
{
ValueNameDescList<int> list = new ValueNameDescList<int>();
list.Add(0, StringTable.Permission.Ivr_Reject);
list.Add(1, StringTable.Permission.Ivr_NeedApply);
list.Add(2, StringTable.Permission.Ivr_Permit);
this._listIvrBuddy = list;
OptionsControlBase.InnerSetListControlDataSource(this.xcbIvrBuddy, list);
}
protected override void OnVisibleChanged(EventArgs e)
{
base.OnVisibleChanged(e);
}
private void PsPermissionControl_DoubleClick(object sender, EventArgs e)
{
}
private void PsPermissionControl_Load(object sender, EventArgs e)
{
}
private void ReFillIvrElseComboBox()
{
int selectedIndex = this.xcbIvrBuddy.SelectedIndex;
int num2 = this.xcbIvrElse.SelectedIndex;
ValueNameDescList<int> list = new ValueNameDescList<int>();
for (int i = 0; i <= selectedIndex; i++)
{
list.Add(this._listIvrBuddy[i]);
}
OptionsControlBase.InnerSetListControlDataSource(this.xcbIvrElse, list);
int num4 = Math.Min(num2, list.Count - 1);
if (num4 >= 0)
{
this.xcbIvrElse.SelectedIndex = num4;
}
}
private void selectIvr()
{
switch (this._user.GlobalPermission[PermissionPointName.Ivr].Value.Value)
{
case 0:
this.xcbIvrBuddy.SelectedValue = 0;
this.xcbIvrElse.SelectedValue = 0;
return;
case 1:
this.xcbIvrBuddy.SelectedValue = 2;
this.xcbIvrElse.SelectedValue = 2;
return;
case 2:
this.xcbIvrBuddy.SelectedValue = 2;
this.xcbIvrElse.SelectedValue = 1;
return;
case 3:
this.xcbIvrBuddy.SelectedValue = 2;
this.xcbIvrElse.SelectedValue = 0;
return;
case 4:
this.xcbIvrBuddy.SelectedValue = 1;
this.xcbIvrElse.SelectedValue = 1;
return;
case 5:
this.xcbIvrBuddy.SelectedValue = 1;
this.xcbIvrElse.SelectedValue = 0;
return;
}
}
private void tvElse_AfterCollapse(object sender, TreeViewEventArgs e)
{
this.xcbIvrBuddy.Visible = false;
this.xcbIvrElse.Visible = false;
}
private void tvElse_AfterExpand(object sender, TreeViewEventArgs e)
{
int x = (this.tvElse.Location.X + this.tvElse.Nodes[0].Nodes[0].Bounds.Location.X) + 50;
int y = (this.tvElse.Location.Y + this.tvElse.Nodes[0].Nodes[0].Bounds.Location.Y) + 2;
this.xcbIvrBuddy.SetBounds(x, y, this.xcbIvrBuddy.Width, this.xcbIvrBuddy.Height);
this.xcbIvrBuddy.BringToFront();
this.xcbIvrBuddy.Visible = true;
int num3 = x;
int num4 = (this.tvElse.Location.Y + this.tvElse.Nodes[0].Nodes[1].Bounds.Location.Y) + 2;
this.xcbIvrElse.SetBounds(num3, num4, this.xcbIvrElse.Width, this.xcbIvrElse.Height);
this.xcbIvrElse.BringToFront();
this.xcbIvrElse.Visible = true;
}
private void uiData_Changed(object sender, EventArgs e)
{
UiErrorHelper.HandEventSafely(this._iFrameworkWindow, delegate {
base.Modified = true;
});
}
public override bool UpdateData(bool update)
{
try
{
new AsyncBizOperation();
if (update)
{
if (!this.CheckUserInput())
{
return false;
}
if (this.rbAgreeAll.Checked)
{
this._user.GlobalPermission[PermissionPointName.Buddy].Value.ProposedValue = 1;
}
else if (this.rbNeedApply.Checked)
{
this._user.GlobalPermission[PermissionPointName.Buddy].Value.ProposedValue = 2;
}
else if (this.rbRejectAll.Checked)
{
this._user.GlobalPermission[PermissionPointName.Buddy].Value.ProposedValue = 0;
}
if (this.cbStrangerBlock.Checked)
{
this._user.GlobalPermission[PermissionPointName.Contact].Value.ProposedValue = 0;
}
else
{
this._user.GlobalPermission[PermissionPointName.Contact].Value.ProposedValue = 1;
}
int num = this.getIvrValue();
this._user.GlobalPermission[PermissionPointName.Ivr].Value.ProposedValue = num;
}
else
{
if (this._user.GlobalPermission[PermissionPointName.Buddy].Value == 1)
{
this.rbAgreeAll.Checked = true;
}
else if (this._user.GlobalPermission[PermissionPointName.Buddy].Value == 2)
{
this.rbNeedApply.Checked = true;
}
else if (this._user.GlobalPermission[PermissionPointName.Buddy].Value == null)
{
this.rbRejectAll.Checked = true;
}
if (this._user.GlobalPermission[PermissionPointName.Contact].Value == 1)
{
this.cbStrangerBlock.Checked = false;
}
else
{
this.cbStrangerBlock.Checked = true;
}
this.selectIvr();
this.DoEnableIvrElse();
}
base.Modified = false;
return true;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
return false;
}
}
private void xcbIvr_DropDown(object sender, EventArgs e)
{
BalloonHelper.RemoveAll();
}
private void xcbIvrBuddy_MouseHover(object sender, EventArgs e)
{
BalloonHelper.ShowBallon(this.xcbIvrBuddy, StringTable.Permission.Ivr_Tooltip);
}
private void xcbIvrBuddy_SelectedIndexChanged(object sender, EventArgs e)
{
this.ReFillIvrElseComboBox();
}
private void xcbIvrElse_MouseHover(object sender, EventArgs e)
{
BalloonHelper.ShowBallon(this.xcbIvrElse, StringTable.Permission.Ivr_Tooltip);
}
private Imps.Client.Core.User _user
{
get
{
return this._iFrameworkWindow.AccountManager.CurrentUser;
}
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -