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

revision 45 by william, Thu Jul 15 04:40:28 2010 UTC revision 55 by william, Thu Jul 15 08:23:03 2010 UTC
# Line 3  using System.Collections.Generic; Line 3  using System.Collections.Generic;
3  using System.Text;  using System.Text;
4    
5  using gr2lib.core.typedefs;  using gr2lib.core.typedefs;
6    using gr2lib.core.exceptions;
7    
8  namespace gr2lib.core.apiversion  namespace gr2lib.core.apiversion
9  {  {
# Line 32  namespace gr2lib.core.apiversion Line 33  namespace gr2lib.core.apiversion
33              this.customization = customization;              this.customization = customization;
34              this.build = build;              this.build = build;
35          }          }
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()          public override string ToString()
46          {          {
47              return this.version;              return this.version;
# Line 84  namespace gr2lib.core.apiversion Line 93  namespace gr2lib.core.apiversion
93      {      {
94          public granny2apiversion()          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();              this._apiversion = new versiontype();
118              this._apiversionsmatch = this.GrannyVersionsMatch();              this._apiversionsmatch = this.GrannyVersionsMatch();
119              this.GetGrannyVersion();              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            }
130    
131          #region APIVersion Support          #region APIVersion Support
132          private class apiversiontype          private class apiversiontype
133          {          {
# Line 102  namespace gr2lib.core.apiversion Line 142  namespace gr2lib.core.apiversion
142          private bool GrannyVersionsMatch()          private bool GrannyVersionsMatch()
143          {          {
144              return gr2lib.core.coreapi.GrannyVersionsMatch(              return gr2lib.core.coreapi.GrannyVersionsMatch(
145                  apiversiontype.GrannyProductMajorVersion,                  this._expectedapiversion.major,
146                  apiversiontype.GrannyProductMinorVersion,                  this._expectedapiversion.minor,
147                  apiversiontype.GrannyProductCustomization,                  this._expectedapiversion.customization,
148                  apiversiontype.GrannyProductBuildNumber);                  this._expectedapiversion.build);
149          }          }
150          private void GetGrannyVersion()          private void GetGrannyVersion()
151          {          {
# Line 140  namespace gr2lib.core.apiversion Line 180  namespace gr2lib.core.apiversion
180          /// Gets the Loaded Granny2 API Version          /// Gets the Loaded Granny2 API Version
181          /// </summary>          /// </summary>
182          public versiontype apiversion { get { return _apiversion; } }          public versiontype apiversion { get { return _apiversion; } }
183            private versiontype _expectedapiversion;
184          /// <summary>          /// <summary>
185          /// Gets the Expected Granny2 API Version          /// Gets the Expected Granny2 API Version
186          /// </summary>          /// </summary>
187          public versiontype expectedapiversion { get { return new versiontype(apiversiontype.GrannyProductMajorVersion, apiversiontype.GrannyProductMinorVersion, apiversiontype.GrannyProductCustomization, apiversiontype.GrannyProductBuildNumber); } }          public versiontype expectedapiversion { get { return _expectedapiversion; } }
188          #endregion          #endregion
189      }      }
190      #endregion      #endregion

Legend:
Removed from v.45  
changed lines
  Added in v.55

  ViewVC Help
Powered by ViewVC 1.1.22