ITC81DB_2H/ITC81DB_0H/Controls/CenterConfiguration/ControlCenterConfiOptionBoa...

118 lines
3.3 KiB
C#

using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using ITC81DB_2H_ImageDll;
using ITC81DB_0H.Forms;
namespace ITC81DB_0H.Controls
{
public partial class ControlCenterConfiOptionBoard : UserControl
{
#region Field
private FormMenu m_ParentForm;
private ControlConfiOptionBoard1 ControlOPT1;
private ControlConfiOptionBoard2 ControlOPT2;
#endregion
#region Constructor
public ControlCenterConfiOptionBoard(FormMenu parent)
{
InitializeComponent();
this.ParentForm = parent;
this.DefaultSetting();
this.InitializeDesign();
}
#endregion
#region Property
public FormMenu ParentForm
{
get { return this.m_ParentForm; }
private set { this.m_ParentForm = value; }
}
#endregion
#region Method
public void InitializeDesign()
{
int value = 0;
value = int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard);
if (value == 1)
this.ControlOPT1.InitializeDesign();
else if (value == 2)
this.ControlOPT2.InitializeDesign();
this.ParentForm.ParentForm.ChildFormMainDisplay.CurrentBottomMenuControlEnable();
}
private void DefaultSetting()
{
this.ControlOPT1 = new ControlConfiOptionBoard1(this.ParentForm);
this.ControlOPT2 = new ControlConfiOptionBoard2(this.ParentForm);
this.Controls.Add(this.ControlOPT1);
this.Controls.Add(this.ControlOPT2);
this.ControlOPT1.Location = new Point(0, 0);
this.ControlOPT2.Location = new Point(0, 0);
this.ControlOPT1.Visible = this.ControlOPT2.Visible = false;
}
private void UpdateDisplay(SystemStatus status)
{
int value = 0;
try
{
value = int.Parse(this.ParentForm.ParentForm.CurrentSystemParameter1.OptionBoard);
}
catch
{
value = 0;
}
if (value == 1)
{
this.ControlOPT1.Visible = true;
this.ControlOPT2.Visible = false;
this.ControlOPT1.BringToFront();
this.ControlOPT1.DisplayRefresh(status);
}
else if (value == 2)
{
this.ControlOPT1.Visible = false;
this.ControlOPT2.Visible = true;
this.ControlOPT2.BringToFront();
this.ControlOPT2.DisplayRefresh(status);
}
else
{
this.ControlOPT1.Visible = false;
this.ControlOPT2.Visible = false;
}
}
public void DisplayRefresh(SystemStatus status)
{
this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = DataStore.DisplayStore.ConfiOptionBoard;
this.ParentForm.ParentForm.SetDisplayMode(DataStore.DisplayMode.Menu);
this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus);
this.UpdateDisplay(status);
}
#endregion
}
}