89 lines
2.6 KiB
C#
89 lines
2.6 KiB
C#
//----------------------------------------------------------------------------
|
|
//
|
|
// Copyright © 2009-2010, Intel Corporation. All rights reserved.
|
|
//
|
|
// File: BaseForm.cs
|
|
//
|
|
//----------------------------------------------------------------------------
|
|
|
|
using System;
|
|
using System.IO;
|
|
using System.Windows.Forms;
|
|
|
|
namespace UCT.Forms
|
|
{
|
|
/// <summary>
|
|
/// The base form - all the tool forms inherit from this form
|
|
/// </summary>
|
|
public class BaseForm : System.Windows.Forms.Form
|
|
{
|
|
#region - Consts -
|
|
|
|
private const string HELP_FILE_NAME = "UserConsentTool.chm";
|
|
|
|
#endregion
|
|
|
|
#region - Constructors -
|
|
|
|
/// <summary>
|
|
/// All forms should be derived from <code>BaseForm</code> class.
|
|
/// Currently its supplies a common icon.
|
|
/// </summary>
|
|
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 -
|
|
|
|
/// <summary>
|
|
/// Open the help file
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
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
|
|
}
|
|
}
|