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_0H.Forms; using ITC81DB_0H_ImageDll; using SmartX; namespace ITC81DB_0H.Controls { public partial class ControlCenterEquipHelp : UserControl { #region Field private FormMenu m_ParentForm; private DataStore.MenuBottomEquipment CurrentMenu; #endregion #region Constructor public ControlCenterEquipHelp(FormMenu parent) { InitializeComponent(); this.ParentForm = parent; this.InitializeDesign(); this.DefaultSetting(); } #endregion #region Property public FormMenu ParentForm { get { return this.m_ParentForm; } private set { this.m_ParentForm = value; } } #endregion #region Method public void InitializeDesign() { Class1 images = new Class1(); if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.English) { this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpUpdateDisable)); this.buttonUpdate.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpUpdateDown)); this.buttonUpdate.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpUpdateUp)); this.buttonInitialize.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInitializationDisable)); this.buttonInitialize.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInitializationDown)); this.buttonInitialize.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpInitializationUp)); this.buttonEngineerSetting.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpEngineerDisable)); this.buttonEngineerSetting.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpEngineerDown)); this.buttonEngineerSetting.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpEngineerUp)); this.buttonFunction.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpFunctionDisable)); this.buttonFunction.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpFunctionDown)); this.buttonFunction.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpFunctionUp)); this.buttonUser.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpUserDisable)); this.buttonUser.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpUserDown)); this.buttonUser.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpUserUp)); this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpEquipmentTestDisable)); this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpEquipmentTestDown)); this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.engHelpEquipmentTestUp)); } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Chinese) { this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpUpdateDisable)); this.buttonUpdate.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpUpdateDown)); this.buttonUpdate.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpUpdateUp)); this.buttonInitialize.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInitializationDisable)); this.buttonInitialize.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInitializationDown)); this.buttonInitialize.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpInitializationUp)); this.buttonEngineerSetting.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpEngineerDisable)); this.buttonEngineerSetting.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpEngineerDown)); this.buttonEngineerSetting.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpEngineerUp)); this.buttonFunction.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpFunctionDisable)); this.buttonFunction.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpFunctionDown)); this.buttonFunction.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpFunctionUp)); this.buttonUser.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpUserDisable)); this.buttonUser.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpUserDown)); this.buttonUser.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpUserUp)); this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpEquipmentTestDisable)); this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpEquipmentTestDown)); this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.chnHelpEquipmentTestUp)); } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Czech) { } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.Russian) { this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpUpdateDisable)); this.buttonUpdate.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpUpdateDown)); this.buttonUpdate.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpUpdateUp)); this.buttonInitialize.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpInitializationDisable)); this.buttonInitialize.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpInitializationDown)); this.buttonInitialize.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpInitializationUp)); this.buttonEngineerSetting.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpEngineerDisable)); this.buttonEngineerSetting.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpEngineerDown)); this.buttonEngineerSetting.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpEngineerUp)); this.buttonFunction.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpFunctionDisable)); this.buttonFunction.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpFunctionDown)); this.buttonFunction.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpFunctionUp)); this.buttonUser.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpUserDisable)); this.buttonUser.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpUserDown)); this.buttonUser.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpUserUp)); this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpEquipmentTestDisable)); this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpEquipmentTestDown)); this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.rusHelpEquipmentTestUp)); } else if (this.ParentForm.ParentForm.SystemConfig1.Language == DataStore.LanguageID.German) { this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpUpdateDisable)); this.buttonUpdate.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpUpdateDown)); this.buttonUpdate.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpUpdateUp)); this.buttonInitialize.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpInitializationDisable)); this.buttonInitialize.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpInitializationDown)); this.buttonInitialize.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpInitializationUp)); this.buttonEngineerSetting.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpEngineerDisable)); this.buttonEngineerSetting.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpEngineerDown)); this.buttonEngineerSetting.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpEngineerUp)); this.buttonFunction.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpFunctionDisable)); this.buttonFunction.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpFunctionDown)); this.buttonFunction.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpFunctionUp)); this.buttonUser.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpUserDisable)); this.buttonUser.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpUserDown)); this.buttonUser.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpUserUp)); this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpEquipmentTestDisable)); this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpEquipmentTestDown)); this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.gerHelpEquipmentTestUp)); } else { this.buttonUpdate.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpUpdateDisable)); this.buttonUpdate.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpUpdateDown)); this.buttonUpdate.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpUpdateUp)); this.buttonInitialize.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInitializationDisable)); this.buttonInitialize.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInitializationDown)); this.buttonInitialize.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpInitializationUp)); this.buttonEngineerSetting.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpEngineerDisable)); this.buttonEngineerSetting.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpEngineerDown)); this.buttonEngineerSetting.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpEngineerUp)); this.buttonFunction.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpFunctionDisable)); this.buttonFunction.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpFunctionDown)); this.buttonFunction.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpFunctionUp)); this.buttonUser.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpUserDisable)); this.buttonUser.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpUserDown)); this.buttonUser.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpUserUp)); this.buttonEquipmentTest.DisableImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpEquipmentTestDisable)); this.buttonEquipmentTest.DownImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpEquipmentTestDown)); this.buttonEquipmentTest.UpImage = new Bitmap(images.GetImage(Class1.ButtonImages.korHelpEquipmentTestUp)); } } private void DefaultSetting() { this.CurrentMenu = DataStore.MenuBottomEquipment.Help; if (this.ParentForm.ParentForm.SystemConfig1.IsLogin == true) this.buttonUser.Visible = true; else this.buttonUser.Visible = false; } public void DisplayHiddenMenu(bool bValue) { if (this.ParentForm.ParentForm.SystemConfig1.IsLogin == true) this.buttonEngineerSetting.Location = new Point(28, 240); else this.buttonEngineerSetting.Location = new Point(526, 17); this.buttonEngineerSetting.Visible = bValue; } private void UpdateDisplayUser(UserItem user) { if (user.Group == DataStore.UserGroup.Level4Developer && this.ParentForm.ParentForm.SystemConfig1.IsLogin == true) this.DisplayHiddenMenu(true); else this.DisplayHiddenMenu(false); } public void DisplayRefresh(SystemStatus status) { this.ParentForm.ParentForm.CurrentSystemStatus.CurrentDisplay = DataStore.DisplayStore.EquipHelp; this.ParentForm.ParentForm.SetDisplayMode(DataStore.DisplayMode.Menu); this.ParentForm.DisplayTitleRoot(this.ParentForm.ParentForm.CurrentSystemStatus); this.UpdateDisplayUser(status.CurrentUser); } #endregion #region Event Handler private void buttonMenu_Click(object sender, EventArgs e) { SmartButton button = sender as SmartButton; if (button == null) return; if (button == this.buttonUpdate) this.CurrentMenu = DataStore.MenuBottomEquipment.Update; else if (button == this.buttonInitialize) this.CurrentMenu = DataStore.MenuBottomEquipment.Initialize; else if (button == this.buttonFunction) this.CurrentMenu = DataStore.MenuBottomEquipment.FunctionSetting; else if (button == this.buttonUser) this.CurrentMenu = DataStore.MenuBottomEquipment.User; else if (button == this.buttonEquipmentTest) this.CurrentMenu = DataStore.MenuBottomEquipment.Test; else if (button == this.buttonEngineerSetting) this.CurrentMenu = DataStore.MenuBottomEquipment.Engineer; else this.CurrentMenu = DataStore.MenuBottomEquipment.Help; this.ParentForm.DisplayBottomEquipment(this.CurrentMenu); } #endregion } }