📄 permissioncontrol.cs
字号:
this.cbEmail.Size = new Size(0x9e, 0x11);
this.cbEmail.TabIndex = 0x11;
this.cbEmail.Text = "向对方公开我的电子邮件";
this.cbEmail.set_UseVisualStyleBackColor(false);
this.cbBirthday.set_AutoSize(true);
this.cbBirthday.BackColor = Color.Transparent;
this.cbBirthday.Location = new System.Drawing.Point(0x25, 0x37);
this.cbBirthday.Name = "cbBirthday";
this.cbBirthday.Size = new Size(170, 0x11);
this.cbBirthday.TabIndex = 15;
this.cbBirthday.Text = "向对方公开我的年龄和生日";
this.cbBirthday.set_UseVisualStyleBackColor(false);
this.groupBox2.Controls.Add(this.rbIvr_Deny);
this.groupBox2.Controls.Add(this.rbIvr_Aprove);
this.groupBox2.Controls.Add(this.rbIvr_Agree);
this.groupBox2.Controls.Add(this.lbIvr);
this.groupBox2.Location = new System.Drawing.Point(3, 0xce);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new Size(0x16c, 0x59);
this.groupBox2.TabIndex = 0x11;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "手机语聊";
this.rbIvr_Deny.set_AutoSize(true);
this.rbIvr_Deny.Location = new System.Drawing.Point(0xdf, 0x36);
this.rbIvr_Deny.Name = "rbIvr_Deny";
this.rbIvr_Deny.Size = new Size(0x31, 0x11);
this.rbIvr_Deny.TabIndex = 0x10;
this.rbIvr_Deny.TabStop = true;
this.rbIvr_Deny.Text = "拒绝";
this.rbIvr_Deny.set_UseVisualStyleBackColor(true);
this.rbIvr_Aprove.set_AutoSize(true);
this.rbIvr_Aprove.Location = new System.Drawing.Point(0x7a, 0x36);
this.rbIvr_Aprove.Name = "rbIvr_Aprove";
this.rbIvr_Aprove.Size = new Size(0x55, 0x11);
this.rbIvr_Aprove.TabIndex = 0x10;
this.rbIvr_Aprove.TabStop = true;
this.rbIvr_Aprove.Text = "需向我申请";
this.rbIvr_Aprove.set_UseVisualStyleBackColor(true);
this.rbIvr_Agree.set_AutoSize(true);
this.rbIvr_Agree.Location = new System.Drawing.Point(0x25, 0x36);
this.rbIvr_Agree.Name = "rbIvr_Agree";
this.rbIvr_Agree.Size = new Size(0x49, 0x11);
this.rbIvr_Agree.TabIndex = 0x10;
this.rbIvr_Agree.TabStop = true;
this.rbIvr_Agree.Text = "自动接受";
this.rbIvr_Agree.set_UseVisualStyleBackColor(true);
this.lbIvr.set_AutoSize(true);
this.lbIvr.BorderColor = Color.Empty;
this.lbIvr.ButtonBorderStyle = ButtonBorderStyle.None;
this.lbIvr.Location = new System.Drawing.Point(0x22, 0x1d);
this.lbIvr.Name = "lbIvr";
this.lbIvr.Size = new Size(0x8b, 13);
this.lbIvr.TabIndex = 15;
this.lbIvr.Text = "向我发出手机语聊邀请时";
this.groupBox3.Controls.Add(this.checkBoxBlock);
this.groupBox3.Controls.Add(this.label5);
this.groupBox3.Location = new System.Drawing.Point(3, 0x12d);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new Size(0x16c, 0x5c);
this.groupBox3.TabIndex = 0x12;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "黑名单";
base.set_AutoScaleDimensions(new SizeF(6f, 13f));
base.set_AutoScaleMode(1);
this.BackColor = Color.Transparent;
base.Controls.Add(this.groupBox3);
base.Controls.Add(this.groupBox2);
base.Controls.Add(this.groupBox1);
base.Name = "PermissionControl";
base.Size = new Size(370, 0x199);
base.Load += new EventHandler(this.PermissionControl_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
base.ResumeLayout(false);
}
private void PermissionControl_Load(object sender, EventArgs e)
{
if ((this._user.ContactList.Contacts[this._contact.Uri] == null) || (this._contact.Type == ContactType.MobileBuddy))
{
this.groupBox1.Enabled = false;
this.groupBox2.Enabled = false;
}
}
protected override void UIData_Changed(object sender, EventArgs e)
{
UiErrorHelper.HandEventSafely(this._iFrameworkWindow, delegate {
base.Modified = true;
});
}
public override bool UpdateData(bool update)
{
try
{
AsyncBizOperation op = new AsyncBizOperation();
if (update)
{
if (!this.CheckUserInput())
{
return false;
}
this._contact.Permissions[PermissionPointName.Identity].SetProposedValueSafely(this.cbShareInfo.Checked ? 1 : 0);
this._contact.Permissions[PermissionPointName.Birthday].SetProposedValueSafely(this.cbBirthday.Checked ? 1 : 0);
this._contact.Permissions[PermissionPointName.Business].SetProposedValueSafely(this.cbBiz.Checked ? 1 : 0);
this._contact.Permissions[PermissionPointName.Email].SetProposedValueSafely(this.cbEmail.Checked ? 1 : 0);
this._contact.Permissions[PermissionPointName.Phone].SetProposedValueSafely(this.cbPhone.Checked ? 1 : 0);
this._contact.Permissions[PermissionPointName.Presence].SetProposedValueSafely(this.chkPresence.Checked ? 1 : 0);
if (this.rbIvr_Agree.Checked)
{
this._contact.Permissions[PermissionPointName.Ivr].SetProposedValueSafely(1);
}
else if (this.rbIvr_Aprove.Checked)
{
this._contact.Permissions[PermissionPointName.Ivr].SetProposedValueSafely(4);
}
else
{
this._contact.Permissions[PermissionPointName.Ivr].SetProposedValueSafely(0);
}
if (this.checkBoxBlock.Checked)
{
if (!this._user.BlackList.Contains(this._contact.Uri))
{
this._user.ContactList.AsyncAddToBlackList(this._contact.Uri, op);
}
}
else if (this._user.BlackList.Contains(this._contact.Uri))
{
this._user.ContactList.AsyncRemoveFromBlackList(this._contact.Uri, op);
}
}
else
{
this.cbShareInfo.Checked = this._contact.Permissions.PermissionPointIdentity.FinalValue == 1;
this.cbBirthday.Checked = this._contact.Permissions[PermissionPointName.Birthday].ProposedOrFinalValue == 1;
this.cbBiz.Checked = this._contact.Permissions[PermissionPointName.Business].ProposedOrFinalValue == 1;
this.cbPhone.Checked = this._contact.Permissions[PermissionPointName.Phone].ProposedOrFinalValue == 1;
this.cbEmail.Checked = this._contact.Permissions[PermissionPointName.Email].ProposedOrFinalValue == 1;
this.chkPresence.Checked = this._contact.Permissions.PermissionPointPresence.FinalValue == 1;
if (this._contact.Permissions.PermissionPointIvr.FinalValue == 0)
{
this.rbIvr_Deny.Checked = true;
}
else if ((this._contact.Permissions.PermissionPointIvr.FinalValue == 4) || (this._contact.Permissions.PermissionPointIvr.FinalValue == 5))
{
this.rbIvr_Aprove.Checked = true;
}
else
{
this.rbIvr_Agree.Checked = true;
}
this.checkBoxBlock.Checked = this._user.BlackList.Contains(this._contact.Uri);
}
base.Modified = false;
return true;
}
catch (Exception exception)
{
ClientLogger.WriteException(exception);
return false;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -