diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-10-22 16:31:23 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-22 16:31:23 -0400 |
| commit | 165b4c2fb8868045cd9dae3f00280e1c7b513acb (patch) | |
| tree | 47a53e6922e3061c7228daa73fb21b72b1e2806e /MediaBrowser.Common | |
| parent | 3c1114228ba3b6a19cb73fa7f9aaa4e3ce3cab80 (diff) | |
| parent | ce47beba842dc026483dc3649a1efb8c34b30662 (diff) | |
Merge pull request #2251 from MediaBrowser/dev
Dev
Diffstat (limited to 'MediaBrowser.Common')
| -rw-r--r-- | MediaBrowser.Common/MediaBrowser.Common.csproj | 4 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/HttpResponseInfo.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Common/Net/INetworkManager.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.Common/Threading/PeriodicTimer.cs | 72 |
4 files changed, 4 insertions, 91 deletions
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index a46aaf9f7..9ee91684f 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -24,7 +24,6 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <PlatformTarget>AnyCPU</PlatformTarget> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -33,7 +32,6 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release Mono|AnyCPU' "> <DebugType>none</DebugType> @@ -42,7 +40,6 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <ItemGroup> <Reference Include="System" /> @@ -91,7 +88,6 @@ <Compile Include="Security\IRequiresRegistration.cs" /> <Compile Include="Security\ISecurityManager.cs" /> <Compile Include="Security\PaymentRequiredException.cs" /> - <Compile Include="Threading\PeriodicTimer.cs" /> <Compile Include="Updates\IInstallationManager.cs" /> <Compile Include="Updates\InstallationEventArgs.cs" /> <Compile Include="Updates\InstallationFailedEventArgs.cs" /> diff --git a/MediaBrowser.Common/Net/HttpResponseInfo.cs b/MediaBrowser.Common/Net/HttpResponseInfo.cs index 890c893e6..ed941a447 100644 --- a/MediaBrowser.Common/Net/HttpResponseInfo.cs +++ b/MediaBrowser.Common/Net/HttpResponseInfo.cs @@ -1,5 +1,5 @@ using System; -using System.Collections.Specialized; +using System.Collections.Generic; using System.IO; using System.Net; @@ -50,16 +50,18 @@ namespace MediaBrowser.Common.Net /// Gets or sets the headers. /// </summary> /// <value>The headers.</value> - public NameValueCollection Headers { get; set; } + public Dictionary<string,string> Headers { get; set; } private readonly IDisposable _disposable; public HttpResponseInfo(IDisposable disposable) { _disposable = disposable; + Headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } public HttpResponseInfo() { + Headers = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); } public void Dispose() diff --git a/MediaBrowser.Common/Net/INetworkManager.cs b/MediaBrowser.Common/Net/INetworkManager.cs index de63ddd51..0a565f670 100644 --- a/MediaBrowser.Common/Net/INetworkManager.cs +++ b/MediaBrowser.Common/Net/INetworkManager.cs @@ -8,12 +8,6 @@ namespace MediaBrowser.Common.Net public interface INetworkManager { /// <summary> - /// Gets the machine's local ip address - /// </summary> - /// <returns>IPAddress.</returns> - IEnumerable<IPAddress> GetLocalIpAddresses(); - - /// <summary> /// Gets a random port number that is currently available /// </summary> /// <returns>System.Int32.</returns> @@ -46,13 +40,6 @@ namespace MediaBrowser.Common.Net IEnumerable<FileSystemEntryInfo> GetNetworkDevices(); /// <summary> - /// Parses the specified endpointstring. - /// </summary> - /// <param name="endpointstring">The endpointstring.</param> - /// <returns>IPEndPoint.</returns> - IPEndPoint Parse(string endpointstring); - - /// <summary> /// Determines whether [is in local network] [the specified endpoint]. /// </summary> /// <param name="endpoint">The endpoint.</param> diff --git a/MediaBrowser.Common/Threading/PeriodicTimer.cs b/MediaBrowser.Common/Threading/PeriodicTimer.cs deleted file mode 100644 index 75ccada4e..000000000 --- a/MediaBrowser.Common/Threading/PeriodicTimer.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Threading; -using Microsoft.Win32; - -namespace MediaBrowser.Common.Threading -{ - public class PeriodicTimer : IDisposable - { - public Action<object> Callback { get; set; } - private Timer _timer; - private readonly object _state; - private readonly object _timerLock = new object(); - private readonly TimeSpan _period; - - public PeriodicTimer(Action<object> callback, object state, TimeSpan dueTime, TimeSpan period) - { - if (callback == null) - { - throw new ArgumentNullException("callback"); - } - - Callback = callback; - _period = period; - _state = state; - - StartTimer(dueTime); - } - - void SystemEvents_PowerModeChanged(object sender, PowerModeChangedEventArgs e) - { - if (e.Mode == PowerModes.Resume) - { - DisposeTimer(); - StartTimer(Timeout.InfiniteTimeSpan); - } - } - - private void TimerCallback(object state) - { - Callback(state); - } - - private void StartTimer(TimeSpan dueTime) - { - lock (_timerLock) - { - _timer = new Timer(TimerCallback, _state, dueTime, _period); - - SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged; - } - } - - private void DisposeTimer() - { - SystemEvents.PowerModeChanged -= SystemEvents_PowerModeChanged; - - lock (_timerLock) - { - if (_timer != null) - { - _timer.Dispose(); - _timer = null; - } - } - } - - public void Dispose() - { - DisposeTimer(); - } - } -} |
