Skip to content

Instantly share code, notes, and snippets.

@cyberzed
Created August 10, 2012 22:10
Show Gist options
  • Save cyberzed/3318545 to your computer and use it in GitHub Desktop.
Save cyberzed/3318545 to your computer and use it in GitHub Desktop.
Not sure this will be a sane solution...
public class SemanticVersionComparer : IComparer<SemanticVersion>
{
private IDictionary<VersionType, Func<SemanticVersion, SemanticVersion, int>> comparisons =
new Dictionary<VersionType, Func<SemanticVersion, SemanticVersion, int>>();
public int Compare(SemanticVersion x, SemanticVersion y)
{
if (x == y)
{
return 0;
}
if (x == null)
{
return -1;
}
if (y == null)
{
return 1;
}
var xVersionType = x.VersionType;
var yVersionType = y.VersionType;
if (xVersionType == yVersionType)
{
return 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment