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

Diff of /trunk/gr2lib_UnitTest/Program.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.44  
changed lines
  Added in v.50

  ViewVC Help
Powered by ViewVC 1.1.22