📄 singlebeiviteform.cs
字号:
namespace Imps.Client.Pc
{
using Imps.Client.Core;
using Imps.Client.Pc.BizControls;
using Imps.Client.Pc.Controls;
using Imps.Client.Resource;
using Imps.Client.Utils;
using Imps.Utils;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
public class SingleBeIviteForm : IVRFormBase
{
private int _startTickets;
private XButton btnAccept;
private XButton btnCancel;
private IContainer components;
private XLabel lblBeInviteUsers;
private XLabel lblChargeInfo;
private XLabel lblInviteInfo;
private XLabel lblSeparator;
private LinkLabel lnkInfoAddress;
private LinkLabel lnkInviteUser;
private IVRListBox lstContacts;
private Panel panel1;
private DisplayPortrait PicContact;
public SingleBeIviteForm(IFrameworkWindow frameworkWnd, Imps.Client.Pc.IVRManager manager, IVRDialog dialog) : base(frameworkWnd, manager, dialog)
{
this.InitializeComponent();
if (dialog.IVRList.Count == 1)
{
base.Height = 0xe4;
this.MinimumSize = new Size(base.Width, 0xe4);
this.MaximumSize = new Size(base.Width, 0xe4);
}
this.initComponentRegion();
this.lblChargeInfo.Text = base.ChargeInfo;
this.lblBeInviteUsers.UseMnemonic = false;
this.lblInviteInfo.UseMnemonic = false;
this.lnkInviteUser.UseMnemonic = false;
}
private void btnAccept_Click(object sender, EventArgs e)
{
try
{
base.OwnerDialog.AcceptInvite();
this.FormatForm(string.Format("您已经接受了 {0} 的手机语聊邀请,请稍后接听来自 {1} 的电话", base.GetContactDisplayName(base.OwnerDialog.InviteContactIVR.Contact.DisplayName), this.ServiceNo));
}
catch (Exception exception)
{
base.Close();
ClientLogger.WriteException(exception);
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
base.Close();
}
private void Contact_PropertiesChanged(object sender, PropertiesChangedEventArgs e)
{
Imps.Client.Core.Contact owner = (sender as Imps.Client.Core.ContactInfo).Owner;
IVRListItem listItem = this.GetListItem(owner);
if (listItem != null)
{
if (e.ContainsProperty("Portrait"))
{
ControlHelper.FadeinImage(listItem, owner.PersonalInfo.Portrait);
}
listItem.Name = owner.DisplayName;
listItem.MoodePhrase = owner.Presence.MoodPhrase;
}
}
private void ContactList_ContactsChanged(object sender, ContactsChangedEventArgs e)
{
UiErrorHelper.HandEventSafely(base.FrameworkWindow, delegate {
foreach (ContactChangedEventArgs args in e.ContactChangedEventArgsCollection)
{
Imps.Client.Core.Contact contact = args.Contact;
IVRListItem listItem = this.GetListItem(contact);
if (listItem != null)
{
listItem.Image = contact.PersonalInfo.Portrait;
listItem.Name = contact.DisplayName;
listItem.MoodePhrase = contact.Presence.MoodPhrase;
}
}
});
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void FormatForm(string inviteInfo)
{
UiErrorHelper.HandEventSafely(base.FrameworkWindow, delegate {
this.btnAccept.Visible = false;
this.btnCancel.Text = "关闭";
this.lblInviteInfo.ForeColor = Color.DarkOrchid;
this.lblInviteInfo.Text = inviteInfo;
this.lnkInviteUser.Visible = false;
});
}
private void FormatMultiIVR()
{
this.lstContacts.IVRItemHeight = 60;
this.lstContacts.ShowOneLine = true;
foreach (Imps.Client.Core.IVR ivr in base.OwnerDialog.IVRList)
{
if (ivr != base.OwnerDialog.InviteContactIVR)
{
IVRListItem item = new IVRListItem(this.lstContacts);
item.Description = IMPSEnums.GetEnumDescription<IVRParticipantStatus>(ivr.Status);
item.Image = ivr.Contact.PersonalInfo.Portrait;
item.MoodePhrase = ivr.Contact.Presence.MoodPhrase;
item.Name = ivr.Contact.DisplayName;
item.ShowCancelButton = false;
item.Context = ivr;
this.lstContacts.Items.Add(item);
ivr.Contact.PersonalInfo.PropertiesChanged += new EventHandler<PropertiesChangedEventArgs>(this.Contact_PropertiesChanged);
}
}
this.lstContacts.IVRNameClick += new EventHandler<IVRListItemEventArgs>(this.lstContacts_IVRNameClick);
this.lstContacts.IVRImageClick += new EventHandler<IVRListItemEventArgs>(this.lstContacts_IVRImageClick);
scroll_widget _widget = scroll_maker.instance.vscroll();
_widget.host = this.lstContacts;
this.lstContacts.Parent.Controls.Add(_widget);
}
private IVRListItem GetListItem(Imps.Client.Core.Contact contact)
{
foreach (object obj2 in this.lstContacts.Items)
{
if ((obj2 is IVRListItem) && (((obj2 as IVRListItem).Context as Imps.Client.Core.IVR).Contact == contact))
{
return (obj2 as IVRListItem);
}
}
return null;
}
private void InitializeComponent()
{
this.components = new Container();
ComponentResourceManager manager = new ComponentResourceManager(typeof(SingleBeIviteForm));
this.panel1 = new Panel();
this.btnCancel = new XButton();
this.btnAccept = new XButton();
this.lblChargeInfo = new XLabel();
this.lblBeInviteUsers = new XLabel();
this.lblSeparator = new XLabel();
this.lstContacts = new IVRListBox();
this.PicContact = new DisplayPortrait();
this.lnkInviteUser = new LinkLabel();
this.lblInviteInfo = new XLabel();
this.lnkInfoAddress = new LinkLabel();
this.panel1.SuspendLayout();
base.SuspendLayout();
this.panel1.BackColor = Color.Transparent;
this.panel1.Controls.Add(this.btnCancel);
this.panel1.Controls.Add(this.btnAccept);
this.panel1.Controls.Add(this.lblChargeInfo);
this.panel1.Controls.Add(this.lblBeInviteUsers);
this.panel1.Controls.Add(this.lblSeparator);
this.panel1.Controls.Add(this.lstContacts);
this.panel1.Controls.Add(this.PicContact);
this.panel1.Controls.Add(this.lnkInviteUser);
this.panel1.Controls.Add(this.lblInviteInfo);
this.panel1.Controls.Add(this.lnkInfoAddress);
this.panel1.Dock = DockStyle.Fill;
this.panel1.Location = new Point(4, 4);
this.panel1.Name = "panel1";
this.panel1.Size = new Size(0x204, 0x193);
this.panel1.TabIndex = 0;
this.panel1.Paint += new PaintEventHandler(this.panel1_Paint);
this.btnCancel.Location = new Point(0x18e, 0x77);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new Size(0x4b, 0x17);
this.btnCancel.TabIndex = 0x16;
this.btnCancel.Text = "取消";
this.btnCancel.UseVisualStyleBackColor = true;
this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
this.btnAccept.Location = new Point(0xe3, 0x77);
this.btnAccept.Name = "btnAccept";
this.btnAccept.Size = new Size(0x9a, 0x17);
this.btnAccept.TabIndex = 0x15;
this.btnAccept.Text = "同意-199秒后超时";
this.btnAccept.UseVisualStyleBackColor = true;
this.btnAccept.Click += new EventHandler(this.btnAccept_Click);
this.lblChargeInfo.AutoSize = true;
this.lblChargeInfo.BorderColor = Color.Empty;
this.lblChargeInfo.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblChargeInfo.ForeColor = Color.DarkOrchid;
this.lblChargeInfo.Location = new Point(130, 0x57);
this.lblChargeInfo.Name = "lblChargeInfo";
this.lblChargeInfo.Size = new Size(0x79, 13);
this.lblChargeInfo.TabIndex = 0x1b;
this.lblChargeInfo.Text = "资费请咨询当地10086";
this.lblBeInviteUsers.AutoSize = true;
this.lblBeInviteUsers.BorderColor = Color.Empty;
this.lblBeInviteUsers.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblBeInviteUsers.Font = new Font("Microsoft Sans Serif", 9f);
this.lblBeInviteUsers.ForeColor = SystemColors.Desktop;
this.lblBeInviteUsers.Location = new Point(12, 0xac);
this.lblBeInviteUsers.Name = "lblBeInviteUsers";
this.lblBeInviteUsers.Size = new Size(0x4f, 15);
this.lblBeInviteUsers.TabIndex = 0x1a;
this.lblBeInviteUsers.Text = "其他被邀请人";
this.lblSeparator.BorderColor = Color.Empty;
this.lblSeparator.BorderStyle = BorderStyle.Fixed3D;
this.lblSeparator.ButtonBorderStyle = ButtonBorderStyle.None;
this.lblSeparator.Location = new Point(0x4e, 0xb5);
this.lblSeparator.Name = "lblSeparator";
this.lblSeparator.Size = new Size(360, 2);
this.lblSeparator.TabIndex = 0x19;
this.lstContacts.BorderStyle = BorderStyle.None;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -