Added plugin configuration downloading

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti 2012-09-03 23:11:16 -04:00
parent fc735e9187
commit 26db4b2cd9
2 changed files with 18 additions and 6 deletions

View File

@ -74,7 +74,22 @@ namespace MediaBrowser.Common.Plugins
}
}
public DateTime ConfigurationDateLastModified { get; private set; }
private DateTime? _ConfigurationDateLastModified = null;
public DateTime ConfigurationDateLastModified
{
get
{
if (_ConfigurationDateLastModified == null)
{
if (File.Exists(ConfigurationFilePath))
{
_ConfigurationDateLastModified = File.GetLastWriteTime(ConfigurationFilePath);
}
}
return _ConfigurationDateLastModified ?? DateTime.MinValue;
}
}
/// <summary>
/// Gets the path to the assembly file
@ -192,7 +207,8 @@ namespace MediaBrowser.Common.Plugins
Configuration = XmlSerializer.DeserializeFromFile(ConfigurationType, ConfigurationFilePath) as BasePluginConfiguration;
}
ConfigurationDateLastModified = File.GetLastWriteTime(ConfigurationFilePath);
// Reset this so it will be loaded again next time it's accessed
_ConfigurationDateLastModified = null;
}
}
}

View File

@ -1,12 +1,8 @@
using System;
using System.Reflection;
using System.Windows;
using System.Windows.Media.Imaging;
using MediaBrowser.Common.Kernel;
using MediaBrowser.Common.Logging;
using MediaBrowser.Model.Progress;
using System.Runtime.InteropServices;
using System.Security;
namespace MediaBrowser.Common.UI
{