From 1b95405fa9debccd99122e961d740573c4ee8e87 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 5 Feb 2013 15:56:25 +0000 Subject: [PATCH] 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 --- Greenshot/App.config | 4 ++-- Greenshot/Greenshot.exe.config | 2 +- Greenshot/Helpers/EnvironmentInfo.cs | 9 +++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Greenshot/App.config b/Greenshot/App.config index 0b1f5ce4d..d4ff71058 100644 --- a/Greenshot/App.config +++ b/Greenshot/App.config @@ -1,7 +1,7 @@ - + - + diff --git a/Greenshot/Greenshot.exe.config b/Greenshot/Greenshot.exe.config index 0b1f5ce4d..4543c429f 100644 --- a/Greenshot/Greenshot.exe.config +++ b/Greenshot/Greenshot.exe.config @@ -1,7 +1,7 @@  - + diff --git a/Greenshot/Helpers/EnvironmentInfo.cs b/Greenshot/Helpers/EnvironmentInfo.cs index 9f89a0e75..6fd983970 100644 --- a/Greenshot/Helpers/EnvironmentInfo.cs +++ b/Greenshot/Helpers/EnvironmentInfo.cs @@ -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 {