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
{
///
/// 当前显示的子窗体
///
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);
}
}
///
/// 又击时设置窗体大小状态
///
///
///
protected virtual void frm_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.SetWindowState();
}
///
/// 移动窗体
///
///
///
void frm_MouseDown(object sender, MouseEventArgs e)
{
if (e.Clicks == 1)
LYFZ.WinAPI.Win32.FormMobile(this.Handle);
}
///
/// 在工作区显示子窗体
///
/// 要显示的子窗体类名
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;
}
}
///
/// 设置窗体状态
///
///
public void SetWindowState(System.Windows.Forms.FormWindowState wState)
{
if (this.WindowState != wState)
{
this.WindowState = wState;
}
}
bool isSwitchForms = false;
///
/// 是否为切换窗体时关闭
///
public bool IsSwitchForms
{
get { return isSwitchForms; }
set { isSwitchForms = value; }
}
///
/// 显示登录窗体
///
public virtual void ShowLogin(Form subfrm = null)
{
}
///
/// 获取窗体名
///
public string FormName
{
get { return this.Name; }
}
///
/// 关闭窗体。
///
public void CloseForm()
{
this.isSwitchForms = true;
this.Close();
}
///
/// 退出程序
///
public virtual void ExitApplication()
{
}
///
/// 刷新工具栏按钮
///
public void RefreshTools()
{
this.toolsChatListControl1.RefreshTools();
}
///
/// 在本窗体中显示指定窗体
///
/// 指定窗体的类的完全名称
/// 指定窗体类所在的dll Key
/// 窗体显示方式
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 菜单按钮单击事件
///
/// 设置菜单项单击事
///
///
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);
}
///
/// 时尚窗体系统菜单项单击事件
///
///
///
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);
}
}
}