www.pudn.com > Fetion.rar > EmptyPersonalGroupControl.cs


namespace Imps.Client.Pc 
{ 
    using Imps.Client; 
    using Imps.Client.Pc.BizControls; 
    using Imps.Client.Utils; 
    using System; 
    using System.ComponentModel; 
    using System.Drawing; 
    using System.Windows.Forms; 
 
    public class EmptyPersonalGroupControl : UserControl 
    { 
        private IFrameworkWindow _framework; 
        private IContainer components; 
        private LinkLabel lblHowToCreateGroup; 
        private LinkLabel lblHowToSearch; 
        private LinkLabel lblWhatIsGroup; 
        private menu_widget menuBlank; 
        private Panel panelEmpty; 
        private PictureBox pictureBox1; 
        private PictureBox pictureBox2; 
        private PictureBox pictureBox3; 
        private ToolStripMenuItem tsCreateGroup; 
        private ToolStripMenuItem tsSearchGroup; 
 
        public EmptyPersonalGroupControl(IFrameworkWindow framework) 
        { 
            this.InitializeComponent(); 
            this._framework = framework; 
            if (this._framework.AccountManager.CurrentUser.Status != UserAccountStatus.Logon) 
            { 
                base.Enabled = false; 
            } 
        } 
 
        protected override void Dispose(bool disposing) 
        { 
            if (disposing && (this.components != null)) 
            { 
                this.components.Dispose(); 
            } 
            base.Dispose(disposing); 
        } 
 
        private void InitializeComponent() 
        { 
            this.components = new Container(); 
            ComponentResourceManager manager = new ComponentResourceManager(typeof(EmptyPersonalGroupControl)); 
            this.panelEmpty = new Panel(); 
            this.menuBlank = new menu_widget(this.components); 
            this.tsCreateGroup = new ToolStripMenuItem(); 
            this.tsSearchGroup = new ToolStripMenuItem(); 
            this.lblHowToSearch = new LinkLabel(); 
            this.lblHowToCreateGroup = new LinkLabel(); 
            this.lblWhatIsGroup = new LinkLabel(); 
            this.pictureBox1 = new PictureBox(); 
            this.pictureBox2 = new PictureBox(); 
            this.pictureBox3 = new PictureBox(); 
            this.panelEmpty.SuspendLayout(); 
            this.menuBlank.SuspendLayout(); 
            ((ISupportInitialize) this.pictureBox1).BeginInit(); 
            ((ISupportInitialize) this.pictureBox2).BeginInit(); 
            ((ISupportInitialize) this.pictureBox3).BeginInit(); 
            base.SuspendLayout(); 
            this.panelEmpty.BackColor = Color.Transparent; 
            this.panelEmpty.ContextMenuStrip = this.menuBlank; 
            this.panelEmpty.Controls.Add(this.pictureBox3); 
            this.panelEmpty.Controls.Add(this.pictureBox2); 
            this.panelEmpty.Controls.Add(this.pictureBox1); 
            this.panelEmpty.Controls.Add(this.lblHowToSearch); 
            this.panelEmpty.Controls.Add(this.lblHowToCreateGroup); 
            this.panelEmpty.Controls.Add(this.lblWhatIsGroup); 
            this.panelEmpty.Dock = DockStyle.Fill; 
            this.panelEmpty.Location = new System.Drawing.Point(0, 0); 
            this.panelEmpty.Name = "panelEmpty"; 
            this.panelEmpty.Size = new Size(230, 0x116); 
            this.panelEmpty.TabIndex = 5; 
            this.menuBlank.Items.AddRange(new ToolStripItem[] { this.tsCreateGroup, this.tsSearchGroup }); 
            this.menuBlank.Name = "menuMemberManager"; 
            this.menuBlank.Size = new Size(0x77, 0x30); 
            this.tsCreateGroup.Name = "tsCreateGroup"; 
            this.tsCreateGroup.Size = new Size(0x76, 0x16); 
            this.tsCreateGroup.Text = "创建群"; 
            this.tsCreateGroup.Click += new EventHandler(this.tsCreateGroup_Click); 
            this.tsSearchGroup.Name = "tsSearchGroup"; 
            this.tsSearchGroup.Size = new Size(0x76, 0x16); 
            this.tsSearchGroup.Text = "搜索群"; 
            this.tsSearchGroup.Click += new EventHandler(this.tsSearchGroup_Click); 
            this.lblHowToSearch.AutoSize = true; 
            this.lblHowToSearch.Font = new Font("宋体", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0x86); 
            this.lblHowToSearch.LinkColor = Color.FromArgb(5, 0x66, 0xa1); 
            this.lblHowToSearch.Location = new System.Drawing.Point(0x18, 0x51); 
            this.lblHowToSearch.Name = "lblHowToSearch"; 
            this.lblHowToSearch.Size = new Size(0x5c, 13); 
            this.lblHowToSearch.TabIndex = 5; 
            this.lblHowToSearch.TabStop = true; 
            this.lblHowToSearch.Text = "如何查找群?"; 
            this.lblHowToSearch.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblHowToSearch_LinkClicked); 
            this.lblHowToCreateGroup.AutoSize = true; 
            this.lblHowToCreateGroup.Font = new Font("宋体", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0x86); 
            this.lblHowToCreateGroup.LinkColor = Color.FromArgb(5, 0x66, 0xa1); 
            this.lblHowToCreateGroup.Location = new System.Drawing.Point(0x18, 0x34); 
            this.lblHowToCreateGroup.Name = "lblHowToCreateGroup"; 
            this.lblHowToCreateGroup.Size = new Size(0x5c, 13); 
            this.lblHowToCreateGroup.TabIndex = 3; 
            this.lblHowToCreateGroup.TabStop = true; 
            this.lblHowToCreateGroup.Text = "如何创建群?"; 
            this.lblHowToCreateGroup.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblHowToCreateGroup_LinkClicked); 
            this.lblWhatIsGroup.AutoSize = true; 
            this.lblWhatIsGroup.Font = new Font("宋体", 9.75f, FontStyle.Regular, GraphicsUnit.Point, 0x86); 
            this.lblWhatIsGroup.ForeColor = Color.FromArgb(5, 0x66, 0xa1); 
            this.lblWhatIsGroup.LinkColor = Color.FromArgb(5, 0x66, 0xa1); 
            this.lblWhatIsGroup.Location = new System.Drawing.Point(0x18, 20); 
            this.lblWhatIsGroup.Name = "lblWhatIsGroup"; 
            this.lblWhatIsGroup.Size = new Size(0x4f, 13); 
            this.lblWhatIsGroup.TabIndex = 0; 
            this.lblWhatIsGroup.TabStop = true; 
            this.lblWhatIsGroup.Text = "什么是群?"; 
            this.lblWhatIsGroup.TextAlign = ContentAlignment.MiddleLeft; 
            this.lblWhatIsGroup.LinkClicked += new LinkLabelLinkClickedEventHandler(this.lblWhatIsGroup_LinkClicked); 
            this.pictureBox1.Image = (Image) manager.GetObject("pictureBox1.Image"); 
            this.pictureBox1.Location = new System.Drawing.Point(0x12, 0x1a); 
            this.pictureBox1.Margin = new Padding(0); 
            this.pictureBox1.Name = "pictureBox1"; 
            this.pictureBox1.Size = new Size(3, 3); 
            this.pictureBox1.TabIndex = 6; 
            this.pictureBox1.TabStop = false; 
            this.pictureBox2.Image = (Image) manager.GetObject("pictureBox2.Image"); 
            this.pictureBox2.Location = new System.Drawing.Point(0x12, 0x3a); 
            this.pictureBox2.Margin = new Padding(0); 
            this.pictureBox2.Name = "pictureBox2"; 
            this.pictureBox2.Size = new Size(3, 3); 
            this.pictureBox2.TabIndex = 6; 
            this.pictureBox2.TabStop = false; 
            this.pictureBox3.Image = (Image) manager.GetObject("pictureBox3.Image"); 
            this.pictureBox3.Location = new System.Drawing.Point(0x12, 0x57); 
            this.pictureBox3.Margin = new Padding(0); 
            this.pictureBox3.Name = "pictureBox3"; 
            this.pictureBox3.Size = new Size(3, 3); 
            this.pictureBox3.TabIndex = 6; 
            this.pictureBox3.TabStop = false; 
            base.AutoScaleDimensions = new SizeF(6f, 12f); 
            base.AutoScaleMode = AutoScaleMode.Font; 
            this.BackColor = Color.White; 
            base.Controls.Add(this.panelEmpty); 
            base.Name = "EmptyPersonalGroupControl"; 
            base.Size = new Size(230, 0x116); 
            this.panelEmpty.ResumeLayout(false); 
            this.panelEmpty.PerformLayout(); 
            this.menuBlank.ResumeLayout(false); 
            ((ISupportInitialize) this.pictureBox1).EndInit(); 
            ((ISupportInitialize) this.pictureBox2).EndInit(); 
            ((ISupportInitialize) this.pictureBox3).EndInit(); 
            base.ResumeLayout(false); 
        } 
 
        private void lblHowToCreateGroup_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 
        { 
            try 
            { 
                if (e.Button == MouseButtons.Left) 
                { 
                    ShellHelper.StartUrl(this._framework.AccountManager.CurrentUser.Configuration.SystemSetting.SysClientSetting.NN_CreateGroupUrl); 
                } 
            } 
            catch (Exception exception) 
            { 
                ClientLogger.WriteException(exception); 
            } 
        } 
 
        private void lblHowToSearch_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 
        { 
            try 
            { 
                if (e.Button == MouseButtons.Left) 
                { 
                    ShellHelper.StartUrl(this._framework.AccountManager.CurrentUser.Configuration.SystemSetting.SysClientSetting.NN_FindGroupUrl); 
                } 
            } 
            catch (Exception exception) 
            { 
                ClientLogger.WriteException(exception); 
            } 
        } 
 
        private void lblWhatIsGroup_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) 
        { 
            try 
            { 
                if (e.Button == MouseButtons.Left) 
                { 
                    ShellHelper.StartUrl(this._framework.AccountManager.CurrentUser.Configuration.SystemSetting.SysClientSetting.NN_GroupMeaningUrl); 
                } 
            } 
            catch (Exception exception) 
            { 
                ClientLogger.WriteException(exception); 
            } 
        } 
 
        private void tsCreateGroup_Click(object sender, EventArgs e) 
        { 
            try 
            { 
                this._framework.PersonalGroupManager.CreatePersonalGroup(this._framework.MainWindow); 
            } 
            catch (Exception exception) 
            { 
                ClientLogger.WriteException(exception); 
            } 
        } 
 
        private void tsSearchGroup_Click(object sender, EventArgs e) 
        { 
            try 
            { 
                this._framework.PersonalGroupManager.SearchGroup(this._framework.MainWindow); 
            } 
            catch (Exception exception) 
            { 
                ClientLogger.WriteException(exception); 
            } 
        } 
    } 
}