Added .NET 4.5 check and support, this changes nothing except that we know if 4.5 is installed... which might help with bug fixing.

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2462 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2013-02-05 15:56:25 +00:00
commit 1b95405fa9
3 changed files with 12 additions and 3 deletions

View file

@ -48,6 +48,11 @@ namespace Greenshot.Helpers {
}
}
public static bool IsNet45OrNewer() {
// Class "ReflectionContext" exists from .NET 4.5 onwards.
return Type.GetType("System.Reflection.ReflectionContext", false) != null;
}
public static string EnvironmentToString(bool newline) {
StringBuilder environment = new StringBuilder();
environment.Append("Software version: " + Application.ProductVersion);
@ -62,6 +67,10 @@ namespace Greenshot.Helpers {
environment.Append(", ");
}
environment.Append(".NET runtime version: " + Environment.Version);
if (IsNet45OrNewer()) {
environment.Append("+");
}
if (newline) {
environment.AppendLine();
} else {