/[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

--- trunk/gr2lib_UnitTest/Program.cs	2010/07/15 07:39:08	49
+++ trunk/gr2lib_UnitTest/Program.cs	2010/07/15 07:39:22	50
@@ -4,6 +4,7 @@
 
 using gr2lib.core;
 using gr2lib.core.apiversion;
+using gr2lib.core.exceptions;
 
 namespace gr2lib_UnitTest
 {
@@ -11,25 +12,32 @@
     {
         static void Main(string[] args)
         {
-            // Setup access to check loaded Granny2 API Version
-            granny2apiversion apiversion = new granny2apiversion();
-
-            // Check if the Loaded API Version Matches
-            if (!apiversion.apiversionsmatch)
+            try
             {
-                // the loaded version does not match
-                Console.WriteLine("Warning:\n" +
-                    "\t Loaded Granny2 DLL Version: " + apiversion.apiversion.version + "\n" +
-                    "\t Expected Version: " + apiversion.expectedapiversion.version);
-                // return from void to exit application
-                return;
+                // Setup access to check loaded Granny2 API Version
+                granny2apiversion apiversion = new granny2apiversion();
+
+                // Check if the Loaded API Version Matches
+                if (!apiversion.apiversionsmatch)
+                {
+                    // the loaded version does not match
+                    Console.WriteLine("Warning:\n" +
+                        "\t Loaded Granny2 DLL Version: " + apiversion.apiversion.version + "\n" +
+                        "\t Expected Version: " + apiversion.expectedapiversion.version);
+                    // return from void to exit application
+                    return;
+                }
+                else
+                {
+                    // the loaded version matches
+                    Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);
+                }
+                // if we have arrived at this point, the loaded api version matches the what the library was built against
             }
-            else
+            catch (granny2apiloadexception ex)
             {
-                // the loaded version matches
-                Console.WriteLine("Loaded granny2.dll: " + apiversion.apiversion.version);
+                Console.WriteLine(ex.Message);
             }
-            // if we have arrived at this point, the loaded api version matches the what the library was built against
         }
     }
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22