/[gr2lib]/trunk/gr2lib/core/coreclasses/apiversion/granny2apiversion.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/coreclasses/apiversion/granny2apiversion.cs

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

--- trunk/gr2lib/core/coreclasses/apiversion/granny2apiversion.cs	2010/07/15 08:28:43	60
+++ trunk/gr2lib/core/coreclasses/apiversion/granny2apiversion.cs	2010/07/18 01:58:10	109
@@ -4,6 +4,7 @@
 
 using gr2lib.core.typedefs;
 using gr2lib.core.exceptions;
+using gr2lib.core.interfaces;
 
 namespace gr2lib.core.apiversion
 {
@@ -93,12 +94,6 @@
     #endregion
 
     #region public class Granny2APIVersion
-    public interface igranny2apiversion
-    {
-        bool apiversionsmatch { get; }
-        versiontype apiversion { get; }
-        versiontype expectedapiversion { get; }
-    }
     /// <summary>
     /// Handle's the checking of the Loaded Granny2 API Version
     /// </summary>
@@ -115,13 +110,33 @@
                                              apiversiontype.GrannyProductCustomization,
                                              apiversiontype.GrannyProductBuildNumber);
 
-            granny2apiloader _loader = new granny2apiloader();
+            granny2apiloader _loader = new granny2apiloader(true);
             this._apiversion = new versiontype();
             this._apiversionsmatch = this.GrannyVersionsMatch();
             this.GetGrannyVersion();
  
         }
         /// <summary>
+        /// Default granny2apiversion Constructor: Expect Granny2 API -> 2.7.0.30 (allow disable looking for granny api)
+        /// </summary>
+        public granny2apiversion(bool checkforgrannyapi)
+        {
+            if (checkforgrannyapi)
+            {
+                this._expectedapiversion = new versiontype(
+                                                 apiversiontype.GrannyProductMajorVersion,
+                                                 apiversiontype.GrannyProductMinorVersion,
+                                                 apiversiontype.GrannyProductCustomization,
+                                                 apiversiontype.GrannyProductBuildNumber);
+
+                granny2apiloader _loader = new granny2apiloader(checkforgrannyapi);
+                this._apiversion = new versiontype();
+                this._apiversionsmatch = this.GrannyVersionsMatch();
+                this.GetGrannyVersion();
+            }
+
+        }
+        /// <summary>
         /// granny2apiversion Constructor: set Granny2 API -> major.minor.customization.build
         /// </summary>
         public granny2apiversion(granny_int32x ExpectedMajorVersion, granny_int32x ExpectedMinorVersion, granny_int32x ExpectedCustomization, granny_int32x ExpectedBuildNumber)
@@ -132,23 +147,57 @@
                                  ExpectedCustomization,
                                  ExpectedBuildNumber);
 
-            granny2apiloader _loader = new granny2apiloader();
+            granny2apiloader _loader = new granny2apiloader(true);
             this._apiversion = new versiontype();
             this._apiversionsmatch = this.GrannyVersionsMatch();
             this.GetGrannyVersion();
         }
         /// <summary>
+        /// granny2apiversion Constructor: set Granny2 API -> major.minor.customization.build
+        /// </summary>
+        public granny2apiversion(bool checkforgrannyapi, granny_int32x ExpectedMajorVersion, granny_int32x ExpectedMinorVersion, granny_int32x ExpectedCustomization, granny_int32x ExpectedBuildNumber)
+        {
+            if (checkforgrannyapi)
+            {
+                this._expectedapiversion = new versiontype(
+                                     ExpectedMajorVersion,
+                                     ExpectedMinorVersion,
+                                     ExpectedCustomization,
+                                     ExpectedBuildNumber);
+
+                granny2apiloader _loader = new granny2apiloader(checkforgrannyapi);
+                this._apiversion = new versiontype();
+                this._apiversionsmatch = this.GrannyVersionsMatch();
+                this.GetGrannyVersion();
+            }
+        }
+        /// <summary>
         /// granny2apiversion Constructor: set Granny2 API -> major.minor.customization.build (via string: "0.0.0.0")
         /// </summary>
         public granny2apiversion(string ExceptedVersion)
         {
             this._expectedapiversion = new versiontype(ExceptedVersion);
 
-            granny2apiloader _loader = new granny2apiloader();
+            granny2apiloader _loader = new granny2apiloader(true);
             this._apiversion = new versiontype();
             this._apiversionsmatch = this.GrannyVersionsMatch();
             this.GetGrannyVersion();
         }
+        /// <summary>
+        /// granny2apiversion Constructor: set Granny2 API -> major.minor.customization.build (via string: "0.0.0.0")
+        /// </summary>
+        public granny2apiversion(bool checkforgrannyapi,string ExceptedVersion)
+        {
+            if (checkforgrannyapi)
+            {
+                this._expectedapiversion = new versiontype(ExceptedVersion);
+
+                granny2apiloader _loader = new granny2apiloader(checkforgrannyapi);
+                this._apiversion = new versiontype();
+                this._apiversionsmatch = this.GrannyVersionsMatch();
+                this.GetGrannyVersion();
+            }
+        }
 
         #region APIVersion Support
         private class apiversiontype

 

  ViewVC Help
Powered by ViewVC 1.1.22