You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
using System;
|
|
using System.Reflection;
|
|
using NLog;
|
|
using NzbDrone.Common.EnvironmentInfo;
|
|
|
|
namespace NzbDrone.Mono
|
|
{
|
|
public class MonoRuntimeProvider : RuntimeInfoBase
|
|
{
|
|
private readonly Logger _logger;
|
|
|
|
public MonoRuntimeProvider(Common.IServiceProvider serviceProvider, Logger logger)
|
|
:base(serviceProvider, logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
public override String RuntimeVersion
|
|
{
|
|
get
|
|
{
|
|
try
|
|
{
|
|
var type = Type.GetType("Mono.Runtime");
|
|
|
|
if (type != null)
|
|
{
|
|
var displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
|
|
|
|
if (displayName != null)
|
|
{
|
|
return displayName.Invoke(null, null).ToString();
|
|
}
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
_logger.ErrorException("Unable to get mono version: " + ex.Message, ex);
|
|
}
|
|
|
|
return String.Empty;
|
|
}
|
|
}
|
|
}
|
|
}
|