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

Annotation of /trunk/gr2lib_UnitTest/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 61 - (hide annotations) (download)
Thu Jul 15 08:29:13 2010 UTC (9 years, 6 months ago) by william
File size: 1637 byte(s)
update program.cs

1 william 9 using System;
2     using System.Collections.Generic;
3     using System.Text;
4    
5 william 16 using gr2lib.core;
6     using gr2lib.core.apiversion;
7 william 50 using gr2lib.core.exceptions;
8 william 16
9 william 9 namespace gr2lib_UnitTest
10     {
11 william 58
12 william 9 class Program
13     {
14     static void Main(string[] args)
15     {
16 william 50 try
17     {
18     // Setup access to check loaded Granny2 API Version
19 william 58 granny2apiversion apiversion = new granny2apiversion(shared.EXPECTED_API_VERSION);
20 william 16
21 william 50 // 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 william 61
38    
39    
40    
41 william 16 }
42 william 50 catch (granny2apiloadexception ex)
43 william 16 {
44 william 58 Console.WriteLine(ex.ToString());
45 william 16 }
46 william 58 catch (Exception ex)
47     {
48     Console.WriteLine(ex.ToString());
49     }
50 william 9 }
51     }
52     }

  ViewVC Help
Powered by ViewVC 1.1.22