/[gr2lib]/trunk/gr2lib_UnitTest/Program.cs
ViewVC logotype

Contents of /trunk/gr2lib_UnitTest/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58 - (show annotations) (download)
Thu Jul 15 08:24:01 2010 UTC (9 years, 6 months ago) by william
File size: 1629 byte(s)
update to reflect latest gr2lib

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 using gr2lib.core;
6 using gr2lib.core.apiversion;
7 using gr2lib.core.exceptions;
8
9 namespace gr2lib_UnitTest
10 {
11
12 class Program
13 {
14 static void Main(string[] args)
15 {
16 try
17 {
18 // Setup access to check loaded Granny2 API Version
19 granny2apiversion apiversion = new granny2apiversion(shared.EXPECTED_API_VERSION);
20
21 // Check if the Loaded API Version Matches
22 if (!apiversion.apiversionsmatch)
23 {
24 // the loaded version does not match
25 Console.WriteLine("Warning:\n" +
26 "\t Loaded Granny2 DLL Version: " + apiversion.apiversion.version + "\n" +
27 "\t Expected Version: " + apiversion.expectedapiversion.version);
28 // return from void to exit application
29 return;
30 }
31 else
32 {
33 // the loaded version matches
34 Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);
35 }
36 // if we have arrived at this point, the loaded api version matches the what the library was built against
37 }
38 catch (granny2apiloadexception ex)
39 {
40 Console.WriteLine(ex.ToString());
41 }
42 catch (Exception ex)
43 {
44 Console.WriteLine(ex.ToString());
45 }
46 }
47 }
48 }

  ViewVC Help
Powered by ViewVC 1.1.22