ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/gr2lib/trunk/gr2lib/core/coreclasses/apiversion/granny2apiversion.cs
(Generate patch)

Comparing trunk/gr2lib/core/coreclasses/apiversion/granny2apiversion.cs (file contents):
Revision 54 by william, Thu Jul 15 07:39:08 2010 UTC vs.
Revision 55 by william, Thu Jul 15 08:23:03 2010 UTC

# Line 33 | Line 33 | namespace gr2lib.core.apiversion
33              this.customization = customization;
34              this.build = build;
35          }
36 <
36 >        public versiontype(string version)
37 >        {
38 >            string[] _version = version.Split('.');
39 >            
40 >            this.major = _version[0];
41 >            this.minor = _version[1];
42 >            this.customization = _version[2];
43 >            this.build = _version[3];
44 >        }
45          public override string ToString()
46          {
47              return this.version;
# Line 85 | Line 93 | namespace gr2lib.core.apiversion
93      {
94          public granny2apiversion()
95          {
96 +            this._expectedapiversion = new versiontype(
97 +                                             apiversiontype.GrannyProductMajorVersion,
98 +                                             apiversiontype.GrannyProductMinorVersion,
99 +                                             apiversiontype.GrannyProductCustomization,
100 +                                             apiversiontype.GrannyProductBuildNumber);
101 +
102 +            granny2apiloader _loader = new granny2apiloader();
103 +            this._apiversion = new versiontype();
104 +            this._apiversionsmatch = this.GrannyVersionsMatch();
105 +            this.GetGrannyVersion();
106 +
107 +        }
108 +        public granny2apiversion(granny_int32x ExpectedMajorVersion, granny_int32x ExpectedMinorVersion, granny_int32x ExpectedCustomization, granny_int32x ExpectedBuildNumber)
109 +        {
110 +            this._expectedapiversion = new versiontype(
111 +                                 ExpectedMajorVersion,
112 +                                 ExpectedMinorVersion,
113 +                                 ExpectedCustomization,
114 +                                 ExpectedBuildNumber);
115 +
116 +            granny2apiloader _loader = new granny2apiloader();
117 +            this._apiversion = new versiontype();
118 +            this._apiversionsmatch = this.GrannyVersionsMatch();
119 +            this.GetGrannyVersion();
120 +        }
121 +        public granny2apiversion(string ExceptedVersion)
122 +        {
123 +            this._expectedapiversion = new versiontype(ExceptedVersion);
124 +
125              granny2apiloader _loader = new granny2apiloader();
126              this._apiversion = new versiontype();
127              this._apiversionsmatch = this.GrannyVersionsMatch();
128              this.GetGrannyVersion();
129 <        }  
129 >        }
130 >
131          #region APIVersion Support
132          private class apiversiontype
133          {
# Line 104 | Line 142 | namespace gr2lib.core.apiversion
142          private bool GrannyVersionsMatch()
143          {
144              return gr2lib.core.coreapi.GrannyVersionsMatch(
145 <                apiversiontype.GrannyProductMajorVersion,
146 <                apiversiontype.GrannyProductMinorVersion,
147 <                apiversiontype.GrannyProductCustomization,
148 <                apiversiontype.GrannyProductBuildNumber);
145 >                this._expectedapiversion.major,
146 >                this._expectedapiversion.minor,
147 >                this._expectedapiversion.customization,
148 >                this._expectedapiversion.build);
149          }
150          private void GetGrannyVersion()
151          {
# Line 142 | Line 180 | namespace gr2lib.core.apiversion
180          /// Gets the Loaded Granny2 API Version
181          /// </summary>
182          public versiontype apiversion { get { return _apiversion; } }
183 +        private versiontype _expectedapiversion;
184          /// <summary>
185          /// Gets the Expected Granny2 API Version
186          /// </summary>
187 <        public versiontype expectedapiversion { get { return new versiontype(apiversiontype.GrannyProductMajorVersion, apiversiontype.GrannyProductMinorVersion, apiversiontype.GrannyProductCustomization, apiversiontype.GrannyProductBuildNumber); } }
187 >        public versiontype expectedapiversion { get { return _expectedapiversion; } }
188          #endregion
189      }
190      #endregion

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines