public static CacheFormat FromVersion(CacheFormatVersion formatVersion) { if (formatVersion > CacheFormatVersion.CURRENT) { throw new NotSupportedException(); } CacheFormatVersion versionRequired; if (formatVersion.CompareTo(CacheHeaderStruct.WithStructSizes) >= 0) { versionRequired = CacheHeaderStruct.WithStructSizes; } else { versionRequired = formatVersion; } return(new CacheFormat { FormatVersion = formatVersion, VersionRequired = versionRequired, ChromPeakSize = ChromPeak.GetStructSize(formatVersion), ChromTransitionSize = ChromTransition.GetStructSize(formatVersion), CachedFileSize = CachedFileHeaderStruct.GetStructSize(formatVersion), ChromGroupHeaderSize = ChromGroupHeaderInfo.GetStructSize(formatVersion) }); }
public int CompareTo(SkylineVersion other) { int result = SrmDocumentVersion.CompareTo(other.SrmDocumentVersion); if (result == 0) { result = CacheFormatVersion.CompareTo(other.CacheFormatVersion); } return(result); }