1 // ****************************************************************
2 // Copyright 2007, Charlie Poole
3 // This is free software licensed under the NUnit license. You may
4 // obtain a copy of the license at http://nunit.org/?p=license&r=2.4
5 // ****************************************************************
11 public class RecentFileEntry
13 public static readonly char Separator
= ',';
17 private Version clrVersion
;
19 public RecentFileEntry( string path
)
22 this.clrVersion
= Environment
.Version
;
25 public RecentFileEntry( string path
, Version clrVersion
)
28 this.clrVersion
= clrVersion
;
36 public Version CLRVersion
38 get { return clrVersion; }
43 get { return path != null && System.IO.File.Exists( path ); }
46 public bool IsCompatibleCLRVersion
48 get { return clrVersion.Major <= Environment.Version.Major; }
51 public override string ToString()
53 return Path
+ Separator
+ CLRVersion
.ToString();
56 public static RecentFileEntry
Parse( string text
)
58 int sepIndex
= text
.LastIndexOf( Separator
);
63 return new RecentFileEntry( text
.Substring( 0, sepIndex
),
64 new Version( text
.Substring( sepIndex
+ 1 ) ) );
68 //The last part was not a version, so fall through and return the whole text
71 return new RecentFileEntry( text
);