/[OhmsLawCalc]/trunk/OhmsLawCalc/Form1.cs
ViewVC logotype

Contents of /trunk/OhmsLawCalc/Form1.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 12 - (show annotations) (download)
Wed Jan 29 03:33:23 2014 UTC (5 years, 11 months ago) by william
File size: 1599 byte(s)

1 
2 #define SHOW_DEBUG_MENU // when defined the debug menu will be shown
3 #define ENABLE_API_TESTING // when defined will enable API_TESTING
4 using Enterprise.Logging;
5 using libOhmsLawCalc;
6 using System;
7 using System.Collections.Generic;
8 using System.ComponentModel;
9 using System.Data;
10 using System.Drawing;
11 using System.Text;
12 using System.Windows.Forms;
13
14 namespace OhmsLawCalc
15 {
16 public partial class Form1 : Form
17 {
18 public Form1()
19 {
20 InitializeComponent();
21 NativeMethods.AttachToConsole(true);
22 gLog.CreateLog("OhmsLawCalc.log", false, LogLevel.kLogLevel_All_NoProgress, null);
23 #if SHOW_DEBUG_MENU
24 #warning SHOW_DEBUG_MENU is defined -- please undefine it after your are done testing the API
25 mnuDebug.Visible = true;
26 #else
27 mnuDebug.Visible = false;
28 #endif
29 }
30
31 private void mnuItemExit_Click(object sender, EventArgs e)
32 {
33 this.Close();
34 }
35
36 private void mnuItemTestAPI_Click(object sender, EventArgs e)
37 {
38 #if !ENABLE_API_TESTING
39 // ENABLE_API_TESTING is not defined
40 MessageBox.Show("API Testing has not been enabled.", "Feature Unavailable", MessageBoxButtons.OK, MessageBoxIcon.Warning);
41 return;
42 #else
43 // ENABLE_API_TESTING is defined
44 #warning ENABLE_API_TESTING is defined -- please undefine it after your are done testing the API
45
46 // test API
47 OhmsLawAPITest test = new OhmsLawAPITest();
48 test.TestAPI();
49 #endif
50 }
51 }
52 }

  ViewVC Help
Powered by ViewVC 1.1.22