CEL_Payroll/Ease.UICreator/CreatForm.cs

77 lines
1.8 KiB
C#
Raw Permalink Normal View History

2024-09-17 14:30:13 +06:00
using System;
using System.Collections.Generic;
using System.Text;
using Ease.CoreV35.Model;
using Ease.CoreV35.Caching;
using System.Windows.Forms;
namespace Ease.UICreator
{
public delegate void UIConfiguration(System.Windows.Forms.Form form);
public enum enumUIType
{
Tabular = 1,
TreeView = 2
}
public class UICreator
{
public event Ease.UICreator.UIConfiguration IncpUIConfig;
public UICreator(enumUIType uiType)
{
_uiType = uiType;
}
private MasterForm _msterForm;
public MasterForm MasterForm
{
get
{
if (_msterForm == null)
_msterForm = new MasterForm();
return _msterForm;
}
set
{
_msterForm = value;
}
}
private enumUIType _uiType;
public enumUIType UIType
{
get
{
return _uiType;
}
set
{
_uiType = value;
}
}
public void CreatForm()
{
if (_uiType == enumUIType.Tabular)
{
FrmMasterForm oMForm = new FrmMasterForm();
oMForm.UpdateUIDesign += new UIConfiguration(this.UIConfiguration);
oMForm.showDLg(_msterForm);
}
else
{
FrmMasterTreeView oTForm = new FrmMasterTreeView();
oTForm.UpdateUIDesign += new UIConfiguration(this.UIConfiguration);
oTForm.showDLg(_msterForm);
}
}
public void UIConfiguration(System.Windows.Forms.Form form)
{
if (IncpUIConfig != null)
{
IncpUIConfig(form);
}
}
}
}