using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Intel.Management.Mei { public class MeVersionInfo : IMeVersionInfo { int _major; int _minor; int _revision; string _versionString; public MeVersionInfo(string versionString) { int pos = 0; int start=0; _versionString = versionString; pos = versionString.IndexOf('.', start); if (pos > 0) { _major = int.Parse(versionString.Substring(start,pos-start)); start = pos+1; pos = versionString.IndexOf('.', start); if (pos > 0) { _minor = int.Parse(versionString.Substring(start, pos - start)); start = pos + 1; pos = versionString.IndexOf('.', start); if (pos > 0) { _revision= int.Parse(versionString.Substring(start, pos - start)); } else { _revision= int.Parse(versionString.Substring(start)); } } else { _minor = int.Parse(versionString.Substring(start)); } } pos = versionString.IndexOf('.', start); if (pos > 0) { _revision= int.Parse(versionString.Substring(start, pos - start)); } } public int Major { get { return _major; } } public int Minor { get { return _minor; } } public int Revision { get { return _revision; } } public Decimal Value { get { Decimal result = new Decimal(_major); result = result + ((Decimal)_minor / 10); return result; } } public override string ToString() { return _versionString; } } }