/[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 40 by william, Wed Jul 14 19:15:42 2010 UTC revision 49 by william, Thu Jul 15 07:39:08 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  {  {
10      #region public class VersionType      #region public class VersionType
11      public interface Iversiontype      public interface Iversiontype
12      {      {
13          granny_int32x Major { get; }          granny_int32x major { get; }
14          granny_int32x Minor { get; }          granny_int32x minor { get; }
15          granny_int32x Customization { get; }          granny_int32x customization { get; }
16          granny_int32x Build { get; }          granny_int32x build { get; }
17          string Version { get; }          string version { get; }
18      }      }
19    
20      public class versiontype : Iversiontype      public class versiontype : Iversiontype
21      {      {
22          public versiontype()          public versiontype()
23          {          {
24              this._Major = 0;              this.major = 0;
25              this._Minor = 0;              this.minor = 0;
26              this._Customization = 0;              this.customization = 0;
27              this._Build = 0;              this.build = 0;
28          }          }
29          public versiontype(granny_int32x Major, granny_int32x Minor, granny_int32x Customization, granny_int32x Build)          public versiontype(granny_int32x major, granny_int32x minor, granny_int32x customization, granny_int32x build)
30          {          {
31              this._Major = Major;              this.major = major;
32              this._Minor = Minor;              this.minor = minor;
33              this._Customization = Customization;              this.customization = customization;
34              this._Build = Build;              this.build = build;
35          }          }
36    
37          public override string ToString()          public override string ToString()
38          {          {
39              return this.Version;              return this.version;
40          }          }
41    
42          #region IVersionType Members          #region IVersionType Members
43          /// <summary>          /// <summary>
44          /// Returns a string representation of the Granny2 API Version in format (Major.Minor.Customization.Build)          /// Returns a string representation of the Granny2 API Version in format (major.minor.customization.build)
45          /// </summary>          /// </summary>
46          public string Version { get { return string.Format("{0}.{1}.{2}.{3}", Major, Minor, Customization, Build); } }          public string version { get { return string.Format("{0}.{1}.{2}.{3}", major, minor, customization, build); } }
47          private granny_int32x _Major;          private granny_int32x _major;
48          /// <summary>          /// <summary>
49          /// Returns the Major of the Granny2 API Version (X.0.0.0)          /// Returns the Major of the Granny2 API Version (X.0.0.0)
50          /// </summary>          /// </summary>
51          public granny_int32x Major { get { return _Major; } }          public granny_int32x major { get { return _major; } private set { _major = value; } }
52    
53          private granny_int32x _Minor;          private granny_int32x _minor;
54          /// <summary>          /// <summary>
55          /// Returns the Minor of the Granny2 API Version (0.X.0.0)          /// Returns the Minor of the Granny2 API Version (0.X.0.0)
56          /// </summary>          /// </summary>
57          public granny_int32x Minor { get { return _Minor; } }          public granny_int32x minor { get { return _minor; } private set { _minor = value; } }
58    
59          private granny_int32x _Customization;          private granny_int32x _customization;
60          /// <summary>          /// <summary>
61          /// Returns the Customization of the Granny2 API Version - Customization (0.0.X.0)          /// Returns the Customization of the Granny2 API Version - Customization (0.0.X.0)
62          /// </summary>          /// </summary>
63          public granny_int32x Customization { get { return _Customization; } }          public granny_int32x customization { get { return _customization; } private set { _customization = value; } }
64    
65          private granny_int32x _Build;          private granny_int32x _build;
66          /// <summary>          /// <summary>
67          /// Returns the Build of the Granny2 API Version (0.0.0.X)          /// Returns the Build of the Granny2 API Version (0.0.0.X)
68          /// </summary>          /// </summary>
69          public granny_int32x Build { get { return _Build; } }          public granny_int32x build { get { return _build; } private set { _build = value; } }
70          #endregion          #endregion
71      }      }
72      #endregion      #endregion
73    
74      #region public class Granny2APIVersion      #region public class Granny2APIVersion
75      public interface Igranny2apiversion      public interface igranny2apiversion
76      {      {
77          bool apiversionsmatch { get; }          bool apiversionsmatch { get; }
78          versiontype apiversion { get; }          versiontype apiversion { get; }
# Line 80  namespace gr2lib.core.apiversion Line 81  namespace gr2lib.core.apiversion
81      /// <summary>      /// <summary>
82      /// Handle's the checking of the Loaded Granny2 API Version      /// Handle's the checking of the Loaded Granny2 API Version
83      /// </summary>      /// </summary>
84      public class granny2apiversion : Igranny2apiversion      public class granny2apiversion : igranny2apiversion
85      {      {
86          public granny2apiversion()          public granny2apiversion()
87          {          {
88              this._APIVersion = new versiontype();              granny2apiloader _loader = new granny2apiloader();
89              this._APIVersionsMatch = this.GrannyVersionsMatch();              this._apiversion = new versiontype();
90                this._apiversionsmatch = this.GrannyVersionsMatch();
91              this.GetGrannyVersion();              this.GetGrannyVersion();
92          }            }  
93          #region APIVersion Support          #region APIVersion Support
# Line 109  namespace gr2lib.core.apiversion Line 111  namespace gr2lib.core.apiversion
111          }          }
112          private void GetGrannyVersion()          private void GetGrannyVersion()
113          {          {
114              granny_int32x Major = 0;              granny_int32x major = 0;
115              granny_int32x Minor = 0;              granny_int32x minor = 0;
116              granny_int32x Customization = 0;              granny_int32x customization = 0;
117              granny_int32x Build = 0;              granny_int32x build = 0;
118    
119              gr2lib.core.coreapi.GrannyGetVersion(              gr2lib.core.coreapi.GrannyGetVersion(
120                  ref Major,                  ref major,
121                  ref Minor,                  ref minor,
122                  ref Customization,                  ref customization,
123                  ref Build);                  ref build);
124    
125              this._APIVersion = new versiontype(Major, Minor, Customization, Build);              this._apiversion = new versiontype(major, minor, customization, build);
126    
127          }          }
128          private string GrannyGetVersionString()          private string GrannyGetVersionString()
# Line 130  namespace gr2lib.core.apiversion Line 132  namespace gr2lib.core.apiversion
132          #endregion          #endregion
133    
134          #region IGranny2APIVersion Members          #region IGranny2APIVersion Members
135          private bool _APIVersionsMatch = false;          private bool _apiversionsmatch = false;
136          /// <summary>          /// <summary>
137          /// Indicates that the Loaded Granny2 API Version matches the version that the core library was built against          /// Indicates that the Loaded Granny2 API Version matches the version that the core library was built against
138          /// </summary>          /// </summary>
139          public bool apiversionsmatch { get { return _APIVersionsMatch; } }          public bool apiversionsmatch { get { return _apiversionsmatch; } }
140          private versiontype _APIVersion;          private versiontype _apiversion;
141          /// <summary>          /// <summary>
142          /// Gets the Loaded Granny2 API Version          /// Gets the Loaded Granny2 API Version
143          /// </summary>          /// </summary>
144          public versiontype apiversion { get { return _APIVersion; } }          public versiontype apiversion { get { return _apiversion; } }
145          /// <summary>          /// <summary>
146          /// Gets the Expected Granny2 API Version          /// Gets the Expected Granny2 API Version
147          /// </summary>          /// </summary>

Legend:
Removed from v.40  
changed lines
  Added in v.49

  ViewVC Help
Powered by ViewVC 1.1.22