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

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

  ViewVC Help
Powered by ViewVC 1.1.22