⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 multiivrform.cs

📁 飞信的收发使用csharp进行开发
💻 CS
📖 第 1 页 / 共 2 页
字号:
namespace Imps.Client.Pc
{
    using Imps.Client;
    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 MultiIVRForm : IVRFormBase
    {
        private int _startTickets;
        private XButton btnCancel;
        private XButton btnClose;
        private XButton btnStart;
        private IContainer components;
        private XLabel label1;
        private XLabel label2;
        private XLabel lblBeInviteUsers;
        private XLabel lblChargeInfo;
        private HtmlLabel lblCurrentUser;
        private XLabel lblInviteInfo;
        private IVRListBox lstContacts;
        private Panel panel1;
        private DisplayPortrait PicOwner;

        public MultiIVRForm(IFrameworkWindow frameworkWnd, Imps.Client.Pc.IVRManager manager, IVRDialog dialog) : base(frameworkWnd, manager, dialog)
        {
            this.InitializeComponent();
            scroll_widget _widget = scroll_maker.instance.vscroll();
            _widget.host = this.lstContacts;
            this.lstContacts.Parent.Controls.Add(_widget);
            this.initComponentRegion();
            this.lblInviteInfo.Text = "您正在发起手机语聊,请等待对方接受邀请。";
            this.lblChargeInfo.Text = base.ChargeInfo;
            this.lblBeInviteUsers.UseMnemonic = false;
            this.lblCurrentUser.UseMnemonic = false;
            this.lblInviteInfo.UseMnemonic = false;
            this.lblBeInviteUsers.UseMnemonic = false;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            UiErrorHelper.HandEventSafely(base.FrameworkWindow, delegate {
                if (!this.TryStartIVR())
                {
                    base.FrameworkWindow.UnifiedMessageBox.ShowInfo("必须有联系人接受才可以开始IVR会话!");
                }
            });
        }

        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)
        {
            this.btnCancel.Visible = false;
            this.btnStart.Visible = false;
            this.btnClose.Visible = true;
            this.lblInviteInfo.ForeColor = Color.DarkOrchid;
            this.lblInviteInfo.Text = inviteInfo;
        }

        private IVRListItem GetListItem(Imps.Client.Core.Contact contact)
        {
            try
            {
                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);
                    }
                }
            }
            catch
            {
            }
            return null;
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(MultiIVRForm));
            this.panel1 = new Panel();
            this.lblCurrentUser = new HtmlLabel();
            this.lblChargeInfo = new XLabel();
            this.lblInviteInfo = new XLabel();
            this.btnClose = new XButton();
            this.btnCancel = new XButton();
            this.btnStart = new XButton();
            this.label2 = new XLabel();
            this.lblBeInviteUsers = new XLabel();
            this.label1 = new XLabel();
            this.lstContacts = new IVRListBox();
            this.PicOwner = new DisplayPortrait();
            this.panel1.SuspendLayout();
            base.SuspendLayout();
            this.panel1.BackColor = Color.Transparent;
            this.panel1.Controls.Add(this.lblCurrentUser);
            this.panel1.Controls.Add(this.lblChargeInfo);
            this.panel1.Controls.Add(this.lblInviteInfo);
            this.panel1.Controls.Add(this.btnClose);
            this.panel1.Controls.Add(this.btnCancel);
            this.panel1.Controls.Add(this.btnStart);
            this.panel1.Controls.Add(this.label2);
            this.panel1.Controls.Add(this.lblBeInviteUsers);
            this.panel1.Controls.Add(this.label1);
            this.panel1.Controls.Add(this.lstContacts);
            this.panel1.Controls.Add(this.PicOwner);
            this.panel1.Dock = DockStyle.Fill;
            this.panel1.Location = new Point(4, 4);
            this.panel1.Name = "panel1";
            this.panel1.Size = new Size(0x1b5, 0x1e4);
            this.panel1.TabIndex = 0;
            this.lblCurrentUser.AutoEllipsis = true;
            this.lblCurrentUser.LinkColor = Color.Blue;
            this.lblCurrentUser.Location = new Point(0x89, 20);
            this.lblCurrentUser.Name = "lblCurrentUser";
            this.lblCurrentUser.ParseEmotion = true;
            this.lblCurrentUser.Size = new Size(0x10a, 20);
            this.lblCurrentUser.SpaceDistance = 6;
            this.lblCurrentUser.TabIndex = 0x17;
            this.lblChargeInfo.BorderColor = Color.Empty;
            this.lblChargeInfo.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblChargeInfo.ForeColor = Color.DarkOrchid;
            this.lblChargeInfo.Location = new Point(0x89, 0x5c);
            this.lblChargeInfo.Name = "lblChargeInfo";
            this.lblChargeInfo.Size = new Size(0x119, 0x23);
            this.lblChargeInfo.TabIndex = 0x16;
            this.lblChargeInfo.Text = "资费请咨询当地10086";
            this.lblInviteInfo.AutoEllipsis = true;
            this.lblInviteInfo.BorderColor = Color.Empty;
            this.lblInviteInfo.ButtonBorderStyle = ButtonBorderStyle.None;
            this.lblInviteInfo.Location = new Point(0x89, 0x2e);
            this.lblInviteInfo.Name = "lblInviteInfo";
            this.lblInviteInfo.Size = new Size(0x110, 40);
            this.lblInviteInfo.TabIndex = 0x15;
            this.lblInviteInfo.Text = "您正在发起手机语聊,请等待对方接受邀请。";
            this.btnClose.Location = new Point(0xa5, 0x199);
            this.btnClose.Name = "btnClose";
            this.btnClose.Size = new Size(0x54, 0x17);
            this.btnClose.TabIndex = 8;
            this.btnClose.Text = "关闭";
            this.btnClose.UseVisualStyleBackColor = true;
            this.btnClose.Visible = false;
            this.btnClose.Click += new EventHandler(this.btnClose_Click);
            this.btnCancel.Location = new Point(0xef, 0x199);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(170, 0x17);
            this.btnCancel.TabIndex = 9;
            this.btnCancel.Text = "取消通话";
            this.btnCancel.UseVisualStyleBackColor = true;
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnStart.Location = new Point(30, 0x199);
            this.btnStart.Name = "btnStart";
            this.btnStart.Size = new Size(170, 0x17);
            this.btnStart.TabIndex = 7;
            this.btnStart.Text = "开始通话 (60秒后将自动开始)";
            this.btnStart.UseVisualStyleBackColor = true;
            this.btnStart.Click += new EventHandler(this.btnStart_Click);
            this.label2.BorderColor = Color.Empty;
            this.label2.BorderStyle = BorderStyle.Fixed3D;
            this.label2.ButtonBorderStyle = ButtonBorderStyle.None;
            this.label2.Location = new Point(13, 0x18f);
            this.label2.Name = "label2";
            this.label2.Size = new Size(410, 2);
            this.label2.TabIndex = 6;
            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(15, 0x9c);
            this.lblBeInviteUsers.Name = "lblBeInviteUsers";
            this.lblBeInviteUsers.Size = new Size(0x37, 15);
            this.lblBeInviteUsers.TabIndex = 3;
            this.lblBeInviteUsers.Text = "被邀请者";
            this.label1.BorderColor = Color.Empty;
            this.label1.BorderStyle = BorderStyle.Fixed3D;
            this.label1.ButtonBorderStyle = ButtonBorderStyle.None;
            this.label1.Location = new Point(0x4c, 0xa3);
            this.label1.Name = "label1";
            this.label1.Size = new Size(320, 2);
            this.label1.TabIndex = 4;
            this.lstContacts.BackColor = Color.White;
            this.lstContacts.BorderStyle = BorderStyle.None;
            this.lstContacts.CancelDescription = "取消邀请";
            this.lstContacts.CancelImage = null;
            this.lstContacts.DisableColor = Color.FromArgb(0xa4, 170, 220);
            this.lstContacts.DrawMode = DrawMode.OwnerDrawVariable;
            this.lstContacts.FormattingEnabled = true;
            this.lstContacts.IVRItemHeight = 80;
            this.lstContacts.LnkFont = new Font("Microsoft Sans Serif", 9f, FontStyle.Underline, GraphicsUnit.Point, 0);
            this.lstContacts.Location = new Point(30, 0xbc);
            this.lstContacts.MoodPhraseColor = Color.FromArgb(0xa4, 170, 220);
            this.lstContacts.MoodPhraseFont = new Font("Microsoft Sans Serif", 9f, FontStyle.Regular, GraphicsUnit.Point, 0);
            this.lstContacts.Name = "lstContacts";
            this.lstContacts.SeperatorHeight = 1;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -