📄 pspermissioncontrol.cs
字号:
namespace Imps.Client.Pc.Options
{
using Imps.Client.Core;
using Imps.Client.Pc;
using Imps.Client.Pc.Controls;
using Imps.Client.Pc.Utils;
using Imps.Client.Resource;
using Imps.Client.Utils;
using Imps.Common.Permission;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class PsPermissionControl : OptionsControlBase
{
private IFrameworkWindow _iFrameworkWindow;
private ValueNameDescList<int> _listIvrBuddy;
private CheckBox cbStrangerBlock;
private IContainer components;
private XLabel lbAddBuddyTip;
private XLabel lbBasic;
private XLabel lbOthers;
private RadioButton rbAgreeAll;
private RadioButton rbNeedApply;
private RadioButton rbRejectAll;
private TreeView tvElse;
private XComboBox xcbIvrBuddy;
private XComboBox xcbIvrElse;
public PsPermissionControl(IFrameworkWindow iFrameworkWindow)
{
this._iFrameworkWindow = iFrameworkWindow;
this.InitializeComponent();
this.initIvrBuddyComboBox();
this.lbBasic.Text = StringTable.Authorization.Gerneral;
this.rbAgreeAll.Text = StringTable.Authorization.RbAgreeAll;
this.rbNeedApply.Text = StringTable.Authorization.RbApplyNeeded;
this.rbRejectAll.Text = StringTable.Authorization.RbRejectAll;
this.cbStrangerBlock.Text = StringTable.Authorization.ForbirdStrangers;
this.lbAddBuddyTip.Text = StringTable.Authorization.LbWhenSomebodyAddMe;
this.lbOthers.Text = StringTable.Authorization.OtherAuthPoints;
this.tvElse.ExpandAll();
this.HandleUiEvent();
}
private void cbStrangerBlock_CheckedChanged(object sender, EventArgs e)
{
this.DoEnableIvrElse();
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void DoEnableIvrElse()
{
try
{
this.xcbIvrElse.Enabled = !this.cbStrangerBlock.Checked;
if (this.cbStrangerBlock.Checked)
{
this.xcbIvrElse.SelectedValue = 0;
}
}
catch
{
}
}
private int getIvrValue()
{
int num2 = (this.xcbIvrBuddy.SelectedValue == null) ? -1 : ((int) this.xcbIvrBuddy.SelectedValue);
int num3 = (this.xcbIvrElse.SelectedValue == null) ? -1 : ((int) this.xcbIvrElse.SelectedValue);
switch (num2)
{
case 2:
switch (num3)
{
case 2:
return 1;
case 1:
return 2;
}
return 3;
case 1:
if (num3 == 1)
{
return 4;
}
return 5;
}
return 0;
}
private void HandleUiEvent()
{
this.rbAgreeAll.CheckedChanged += new EventHandler(this.uiData_Changed);
this.rbNeedApply.CheckedChanged += new EventHandler(this.uiData_Changed);
this.rbRejectAll.CheckedChanged += new EventHandler(this.uiData_Changed);
this.cbStrangerBlock.CheckedChanged += new EventHandler(this.uiData_Changed);
this.xcbIvrBuddy.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
this.xcbIvrElse.SelectedIndexChanged += new EventHandler(this.uiData_Changed);
}
private void InitializeComponent()
{
TreeNode node = new TreeNode("好友");
TreeNode node2 = new TreeNode("其他人");
TreeNode node3 = new TreeNode("手机语聊", new TreeNode[] { node, node2 });
this.lbAddBuddyTip = new XLabel();
this.lbOthers = new XLabel();
this.lbBasic = new XLabel();
this.rbAgreeAll = new RadioButton();
this.rbNeedApply = new RadioButton();
this.rbRejectAll = new RadioButton();
this.cbStrangerBlock = new CheckBox();
this.tvElse = new TreeView();
this.xcbIvrBuddy = new XComboBox();
this.xcbIvrElse = new XComboBox();
XLabel label = new XLabel();
XLabel label2 = new XLabel();
base.SuspendLayout();
label.BorderColor = Color.Empty;
label.BorderStyle = BorderStyle.Fixed3D;
label.ButtonBorderStyle = ButtonBorderStyle.None;
label.Location = new Point(0x21, 0xa7);
label.Name = "label3";
label.Size = new Size(320, 2);
label.TabIndex = 8;
label2.BorderColor = Color.Empty;
label2.BorderStyle = BorderStyle.Fixed3D;
label2.ButtonBorderStyle = ButtonBorderStyle.None;
label2.Location = new Point(0x37, 15);
label2.Name = "lbLine";
label2.Size = new Size(300, 2);
label2.TabIndex = 1;
this.lbAddBuddyTip.AutoSize = true;
this.lbAddBuddyTip.BorderColor = Color.Empty;
this.lbAddBuddyTip.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbAddBuddyTip.Location = new Point(0x11, 0x23);
this.lbAddBuddyTip.Name = "lbAddBuddyTip";
this.lbAddBuddyTip.Size = new Size(0x4f, 13);
this.lbAddBuddyTip.TabIndex = 2;
this.lbAddBuddyTip.Text = "lbAddBuddyTip";
this.lbOthers.AutoSize = true;
this.lbOthers.BorderColor = Color.Empty;
this.lbOthers.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbOthers.Location = new Point(5, 160);
this.lbOthers.Name = "lbOthers";
this.lbOthers.Size = new Size(0x2e, 13);
this.lbOthers.TabIndex = 7;
this.lbOthers.Text = "lbOthers";
this.lbBasic.AutoSize = true;
this.lbBasic.BorderColor = Color.Empty;
this.lbBasic.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbBasic.Location = new Point(5, 9);
this.lbBasic.Name = "lbBasic";
this.lbBasic.Size = new Size(0x29, 13);
this.lbBasic.TabIndex = 0;
this.lbBasic.Text = "lbBasic";
this.rbAgreeAll.AutoSize = true;
this.rbAgreeAll.Location = new Point(0x1f, 0x37);
this.rbAgreeAll.Name = "rbAgreeAll";
this.rbAgreeAll.Size = new Size(0x49, 0x11);
this.rbAgreeAll.TabIndex = 3;
this.rbAgreeAll.TabStop = true;
this.rbAgreeAll.Text = "rbAgreeAll";
this.rbAgreeAll.UseVisualStyleBackColor = true;
this.rbNeedApply.AutoSize = true;
this.rbNeedApply.Location = new Point(0x1f, 80);
this.rbNeedApply.Name = "rbNeedApply";
this.rbNeedApply.Size = new Size(0x56, 0x11);
this.rbNeedApply.TabIndex = 4;
this.rbNeedApply.TabStop = true;
this.rbNeedApply.Text = "rbNeedApply";
this.rbNeedApply.UseVisualStyleBackColor = true;
this.rbRejectAll.AutoSize = true;
this.rbRejectAll.Location = new Point(0x1f, 0x69);
this.rbRejectAll.Name = "rbRejectAll";
this.rbRejectAll.Size = new Size(0x4c, 0x11);
this.rbRejectAll.TabIndex = 5;
this.rbRejectAll.TabStop = true;
this.rbRejectAll.Text = "rbRejectAll";
this.rbRejectAll.UseVisualStyleBackColor = true;
this.cbStrangerBlock.AutoSize = true;
this.cbStrangerBlock.Location = new Point(0x11, 130);
this.cbStrangerBlock.Name = "cbStrangerBlock";
this.cbStrangerBlock.Size = new Size(0x69, 0x11);
this.cbStrangerBlock.TabIndex = 6;
this.cbStrangerBlock.Text = "cbStrangerBlock";
this.cbStrangerBlock.UseVisualStyleBackColor = true;
this.cbStrangerBlock.CheckedChanged += new EventHandler(this.cbStrangerBlock_CheckedChanged);
this.tvElse.BorderStyle = BorderStyle.FixedSingle;
this.tvElse.ItemHeight = 0x16;
this.tvElse.Location = new Point(0x13, 0xb7);
this.tvElse.Name = "tvElse";
node.Name = "NodeBuddy";
node.Text = "好友";
node2.Name = "NodeElse";
node2.Text = "其他人";
node3.Name = "nodeIvr";
node3.Text = "手机语聊";
this.tvElse.Nodes.AddRange(new TreeNode[] { node3 });
this.tvElse.Size = new Size(0x146, 0x83);
this.tvElse.TabIndex = 9;
this.tvElse.AfterCollapse += new TreeViewEventHandler(this.tvElse_AfterCollapse);
this.tvElse.AfterExpand += new TreeViewEventHandler(this.tvElse_AfterExpand);
this.xcbIvrBuddy.BackColor = Color.White;
this.xcbIvrBuddy.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbIvrBuddy.FormattingEnabled = true;
this.xcbIvrBuddy.Location = new Point(0x63, 0xd4);
this.xcbIvrBuddy.Name = "xcbIvrBuddy";
this.xcbIvrBuddy.Size = new Size(0xd6, 0x15);
this.xcbIvrBuddy.TabIndex = 10;
this.xcbIvrBuddy.Visible = false;
this.xcbIvrBuddy.MouseHover += new EventHandler(this.xcbIvrBuddy_MouseHover);
this.xcbIvrBuddy.SelectedIndexChanged += new EventHandler(this.xcbIvrBuddy_SelectedIndexChanged);
this.xcbIvrBuddy.DropDown += new EventHandler(this.xcbIvr_DropDown);
this.xcbIvrElse.BackColor = Color.White;
this.xcbIvrElse.DropDownStyle = ComboBoxStyle.DropDownList;
this.xcbIvrElse.FormattingEnabled = true;
this.xcbIvrElse.Location = new Point(0x63, 0xef);
this.xcbIvrElse.Name = "xcbIvrElse";
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -