123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- 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
- {
- /// <summary>
- /// 欢迎窗体
- /// </summary>
- public partial class frmWelcomeForm : LYFZ.ComponentLibrary.BaseContentsFormMain
- {
- public frmWelcomeForm()
- {
- InitializeComponent();
- this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
- this.panelEx1.BackgroundImage = frmWelcomeForm.StudioImageMap; //LYFZ.WinAPI.CustomPublicMethod.GetMenuItemImage("\\影楼形象图.jpg");
- this.plExMainContainer.BackgroundImage = frmWelcomeForm.HomeBackground;// LYFZ.WinAPI.CustomPublicMethod.GetMenuItemImage("\\首页背景.png");
- SetGlassButtonClick(this.plExMainContainer.Controls);
- }
- static Image studioImageMap = null;
- /// <summary>
- /// 影楼形象图
- /// </summary>
- public static Image StudioImageMap
- {
- get
- {
- if (frmWelcomeForm.studioImageMap == null)
- {
- string imagPath = LYFZ.WinAPI.CustomPublicMethod.GetFullDirectoryPath(LYFZ.WinAPI.CustomPublicMethod.BasePath) + "Resources\\SThemeImage\\Rimg_bg.png";
- if (System.IO.File.Exists(imagPath))
- {
- frmWelcomeForm.studioImageMap = LYFZ.WinAPI.CustomPublicMethod.GetPathToBitmap(imagPath);
- }
- else
- {
- frmWelcomeForm.studioImageMap = LYFZ.ImageFunction.ImageOperation.GetNewBitmap(LYFZ.WinAPI.CustomPublicMethod.GetMenuItemImage("\\影楼形象图.png"));
- }
- }
- return frmWelcomeForm.studioImageMap;
- }
- set { frmWelcomeForm.studioImageMap = value; }
- }
- static Image homeBackground = null;
- /// <summary>
- /// 首页背景
- /// </summary>
- public static Image HomeBackground
- {
- get
- {
- if (frmWelcomeForm.homeBackground == null)
- {
- string imagPath = LYFZ.WinAPI.CustomPublicMethod.GetFullDirectoryPath(LYFZ.WinAPI.CustomPublicMethod.BasePath) + "Resources\\SThemeImage\\Bgimg_bg.png";
- if (System.IO.File.Exists(imagPath))
- {
- frmWelcomeForm.homeBackground = LYFZ.WinAPI.CustomPublicMethod.GetPathToBitmap(imagPath);
- }
- else
- {
- frmWelcomeForm.homeBackground = LYFZ.ImageFunction.ImageOperation.GetNewBitmap(LYFZ.WinAPI.CustomPublicMethod.GetMenuItemImage("\\首页背景.png"));
- }
- }
- return frmWelcomeForm.homeBackground;
- }
- set { frmWelcomeForm.homeBackground = value; }
- }
- /// <summary>
- ///
- /// </summary>
- /// <param name="controls"></param>
- void SetGlassButtonClick(Control.ControlCollection controls)
- {
- // ComponentLibrary.GlassButton
- foreach (Control btnControl in controls)
- {
- if (btnControl.GetType() == typeof(ComponentLibrary.GlassButton))
- {
- btnControl.Click += btnControl_Click;
- }
- }
- }
- public void btnControl_Click(object sender, EventArgs e)
- {
- ComponentLibrary.GlassButton gbtn = (ComponentLibrary.GlassButton)sender;
- LYFZ.Model.Model_SystemToolsMenu.Item item = new Model.Model_SystemToolsMenu.Item();
- item.KeyName = gbtn.Name;
- // item.DllFileKey = "SUMB";
- // item.OpenMode = "ShowEmbedded";
- // item.ClassFullName = "LYFZ.Software.PhotoStudio.frmWelcomeForm";//gbtn.Tag.ToString();
- try
- {
- string[] parameters = gbtn.Tag.ToString().Split('|');
- item.DllFileKey = parameters[0];
- item.OpenMode = parameters[1];
- item.ClassFullName = parameters[2];
- }
- catch
- {
- MessageBoxCustom.Show("模块参数不正确,请写管理员联系!");
- return;
- }
- try
- {
- //typeof(LYFZ.StandardInterface.IToolMenuClick).IsAssignableFrom(this.ParentForm.GetType())
- //用于判断父窗体是否实现了指定的LYFZ.StandardInterface.IToolMenuClick接口
- if (typeof(LYFZ.StandardInterface.IToolMenuClick).IsAssignableFrom(this.ParentForm.GetType()))
- {
- LYFZ.StandardInterface.IToolMenuClick iParentForm = (LYFZ.StandardInterface.IToolMenuClick)this.ParentForm;
- DynamicMenu.ToolsClickProcessingMethod(item, iParentForm);
- }
- }
- catch
- {
- MessageBoxCustom.Show("模块加载失败,请写管理员联系!");
- }
- }
- }
- }
|