//---------------------------------------------------------------------------- // // Copyright © 2009-2010, Intel Corporation. All rights reserved. // // File: BaseForm.cs // //---------------------------------------------------------------------------- using System; using System.IO; using System.Windows.Forms; namespace UCT.Forms { /// /// The base form - all the tool forms inherit from this form /// public class BaseForm : System.Windows.Forms.Form { #region - Consts - private const string HELP_FILE_NAME = "UserConsentTool.chm"; #endregion #region - Constructors - /// /// All forms should be derived from BaseForm class. /// Currently its supplies a common icon. /// public BaseForm() { // Required for Windows Form Designer support InitializeComponent(); } private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BaseForm)); this.SuspendLayout(); // // BaseForm // this.ClientSize = new System.Drawing.Size(292, 266); this.HelpButton = true; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.Name = "BaseForm"; this.ShowInTaskbar = false; this.HelpButtonClicked += new System.ComponentModel.CancelEventHandler(this.BaseForm_HelpButtonClicked); this.ResumeLayout(false); } #endregion #region - Methods - /// /// Open the help file /// /// /// protected void BaseForm_HelpButtonClicked(object sender, System.ComponentModel.CancelEventArgs e) { if (!File.Exists(HELP_FILE_NAME)) { AMT_SW_GUI.MessageManager.ShowErrorMessage("User Consent Tool help file does not exist.", "Help File Not Found"); } Help.ShowHelp(this, HELP_FILE_NAME); } public virtual void Disposer() { this.Dispose(true); } public new System.Windows.Forms.DialogResult ShowDialog() { System.Drawing.Font font = new System.Drawing.Font("Tahoma", 8.25f); this.Font = font; return base.ShowDialog(); } #endregion } }