123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace LYFZ.Software.UI
- {
- public partial class frmFashionMain : LYFZ.ComponentLibrary.BaseShadowForm,LYFZ.StandardInterface.IToolMenuClick,LYFZ.StandardInterface.IMenuClick
- {
- /// <summary>
- /// 当前显示的子窗体
- /// </summary>
- LYFZ.ComponentLibrary.BaseContentsFormMain thisChildForm = null;
- LYFZ.BLL.BLL_SystemToolsMenu bllToolsMenu = new BLL.BLL_SystemToolsMenu(false);
- public frmFashionMain()
- {
- this.WindowState = FormWindowState.Maximized;
- InitializeComponent();
- DynamicMenu.SetToolsChatListControl(toolsChatListControl1);
- this.IsUserControlsSize = true;
- this.IsFullScreen = true;
- // LYFZ.Model.Model_SystemToolsMenu.DefaultWelcomeForm dfWelcomeForm = bllToolsMenu.GetDefaultWelcomeForm();
- // ShowChildForm(dfWelcomeForm.ClassFullName, dfWelcomeForm.DllFileKey);
-
- if (DynamicMenu.IsToosClickOpen)
- {
- this.toolsChatListControl1.ClickSubItem += new ComponentLibrary.ChatListControl.ChatListBox.ChatListEventHandler(toolsChatListControl1_ClickSubItem);
- }
- else
- {
- this.toolsChatListControl1.DoubleClickSubItem += new ComponentLibrary.ChatListControl.ChatListBox.ChatListEventHandler(toolsChatListControl1_DoubleClickSubItem);
- }
- }
-
- /// <summary>
- /// 又击时设置窗体大小状态
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- protected virtual void frm_MouseDoubleClick(object sender, MouseEventArgs e)
- {
- this.SetWindowState();
- }
- /// <summary>
- /// 移动窗体
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- void frm_MouseDown(object sender, MouseEventArgs e)
- {
- if (e.Clicks == 1)
- LYFZ.WinAPI.Win32.FormMobile(this.Handle);
- }
- /// <summary>
- /// 在工作区显示子窗体
- /// </summary>
- /// <param name="classFullName">要显示的子窗体类名</param>
- public void ShowChildForm(string classFullName, string dllKey)
- {
- if (LYFZ.BLL.BLL_ErpUser.WhetherTimesOut)
- {
- this.splExFashionMainPanel.Panel2.Enabled = false;
- ShowLogin();
- ShowChildForm(classFullName, dllKey);
- }
- else
- {
- this.splExFashionMainPanel.Panel2.Enabled = true;
- thisChildForm = DynamicMenu.ShowEmbeddedFashionChildForm(classFullName, this.splExFashionMainPanel.Panel2.Controls, dllKey);
- thisChildForm.iMenuClick = this;
- thisChildForm.MouseDown += new System.Windows.Forms.MouseEventHandler(frm_MouseDown);
- thisChildForm.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(frm_MouseDoubleClick);
- thisChildForm.RefreshSystemMeun();
- }
- if (this.WindowState != FormWindowState.Maximized)
- {
- this.WindowState = FormWindowState.Maximized;
- }
- }
- /// <summary>
- /// 设置窗体状态
- /// </summary>
- /// <param name="wState"></param>
- public void SetWindowState(System.Windows.Forms.FormWindowState wState)
- {
- if (this.WindowState != wState)
- {
- this.WindowState = wState;
- }
- }
- bool isSwitchForms = false;
- /// <summary>
- /// 是否为切换窗体时关闭
- /// </summary>
- public bool IsSwitchForms
- {
- get { return isSwitchForms; }
- set { isSwitchForms = value; }
- }
- /// <summary>
- /// 显示登录窗体
- /// </summary>
- public virtual void ShowLogin(Form subfrm = null)
- {
-
-
- }
- /// <summary>
- /// 获取窗体名
- /// </summary>
- public string FormName
- {
- get { return this.Name; }
- }
- /// <summary>
- /// 关闭窗体。
- /// </summary>
- public void CloseForm()
- {
- this.isSwitchForms = true;
- this.Close();
- }
- /// <summary>
- /// 退出程序
- /// </summary>
- public virtual void ExitApplication()
- {
-
- }
-
- /// <summary>
- /// 刷新工具栏按钮
- /// </summary>
- public void RefreshTools()
- {
- this.toolsChatListControl1.RefreshTools();
- }
- /// <summary>
- /// 在本窗体中显示指定窗体
- /// </summary>
- /// <param name="classFullName">指定窗体的类的完全名称</param>
- /// <param name="dllKey">指定窗体类所在的dll Key</param>
- /// <param name="openMode">窗体显示方式</param>
- public void ShowForm(string classFullName, string dllKey, string openMode)
- {
- LYFZ.Model.Model_SystemToolsMenu.Item item = new Model.Model_SystemToolsMenu.Item();
- item.KeyName = "indexFrmFash";
- item.DllFileKey = dllKey;
- item.OpenMode = openMode;
- item.ClassFullName = classFullName;
- DynamicMenu.ToolsClickProcessingMethod(item, this);
- }
- #region 菜单按钮单击事件
- /// <summary>
- /// 设置菜单项单击事
- /// </summary>
- /// <param name="menuItem"></param>
- public void SetIMenuItem_Click(ToolStripMenuItem menuItem)
- {
- //请实现功能
- LYFZ.Model.Model_SystemToolsMenu.Item item = (LYFZ.Model.Model_SystemToolsMenu.Item)menuItem.Tag;
- if (!item.IsChildMenu && item.ClassFullName != "" && item.ClassFullName.ToLower() != "null")
- menuItem.Click += new EventHandler(FrmFashionMainMenuItem_Click);
- }
- /// <summary>
- /// 时尚窗体系统菜单项单击事件
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- public virtual void FrmFashionMainMenuItem_Click(object sender, EventArgs e)
- {
- DynamicMenu.MenuItemClickProcessingMethod(sender, e, this);
- }
- #endregion
- protected virtual void toolsChatListControl1_DoubleClickSubItem(object sender, ComponentLibrary.ChatListControl.ChatListEventArgs e)
- {
- LYFZ.ComponentLibrary.ChatListControl.ChatListSubItem selectSubItem = e.SelectSubItem;
- if (selectSubItem.Status != LYFZ.ComponentLibrary.ChatListControl.ChatListSubItem.UserStatus.OffLine)
- DynamicMenu.ToolsClickProcessingMethod(selectSubItem.Tag, this);
- }
- protected virtual void toolsChatListControl1_ClickSubItem(object sender, ComponentLibrary.ChatListControl.ChatListEventArgs e)
- {
- LYFZ.ComponentLibrary.ChatListControl.ChatListSubItem selectSubItem = e.SelectSubItem;
- if (selectSubItem.Status != LYFZ.ComponentLibrary.ChatListControl.ChatListSubItem.UserStatus.OffLine)
- DynamicMenu.ToolsClickProcessingMethod(selectSubItem.Tag, this);
- }
- }
- }
|