The Free Software Media System - Server Backend & API
remove regions
telans8e3d8748021f
diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.csindex 6982e7333d..c86fc4f374 100644--- a/Emby.Dlna/PlayTo/Device.cs+++ b/Emby.Dlna/PlayTo/Device.cs@@ -19,8 +19,6 @@ namespace Emby.Dlna.PlayTo{public class Device : IDisposable{- #region Fields & Properties-private Timer _timer;public DeviceInfo Properties { get; set; }@@ -53,10 +51,10 @@ namespace Emby.Dlna.PlayTopublic bool IsStopped => TransportState == TRANSPORTSTATE.STOPPED;- #endregion-private readonly IHttpClient _httpClient;+private readonly ILogger _logger;+private readonly IServerConfigurationManager _config;public Action OnDeviceUnavailable { get; set; }@@ -142,8 +140,6 @@ namespace Emby.Dlna.PlayTo}}- #region Commanding-public Task VolumeDown(CancellationToken cancellationToken){var sendVolume = Math.Max(Volume - 5, 0);@@ -402,11 +398,8 @@ namespace Emby.Dlna.PlayToRestartTimer(true);}- #endregion-- #region Get data-private int _connectFailureCount;+private async void TimerCallback(object sender){if (_disposed)@@ -870,10 +863,6 @@ namespace Emby.Dlna.PlayToreturn new string[4];}- #endregion-- #region From XML-private async Task<TransportCommands> GetAVProtocolAsync(CancellationToken cancellationToken){if (AvCommands != null)@@ -1068,8 +1057,6 @@ namespace Emby.Dlna.PlayToreturn new Device(deviceProperties, httpClient, logger, config);}- #endregion-private static readonly CultureInfo UsCulture = new CultureInfo("en-US");private static DeviceIcon CreateIcon(XElement element){@@ -1193,8 +1180,6 @@ namespace Emby.Dlna.PlayTo});}- #region IDisposable-bool _disposed;public void Dispose()@@ -1221,8 +1206,6 @@ namespace Emby.Dlna.PlayTo_disposed = true;}- #endregion-public override string ToString(){return string.Format("{0} - {1}", Properties.Name, Properties.BaseUrl);diff --git a/MediaBrowser.Controller/Library/ItemResolveArgs.cs b/MediaBrowser.Controller/Library/ItemResolveArgs.csindex 1516bb1e9b..731c6d6674 100644--- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs+++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs@@ -224,8 +224,6 @@ namespace MediaBrowser.Controller.Librarypublic string CollectionType { get; set; }- #region Equality Overrides-/// <summary>/// Determines whether the specified <see cref="object" /> is equal to this instance./// </summary>@@ -260,8 +258,5 @@ namespace MediaBrowser.Controller.Libraryreturn false;}-- #endregion}-}diff --git a/MediaBrowser.Controller/Library/Profiler.cs b/MediaBrowser.Controller/Library/Profiler.csindex f9808a4f44..399378a099 100644--- a/MediaBrowser.Controller/Library/Profiler.cs+++ b/MediaBrowser.Controller/Library/Profiler.cs@@ -37,7 +37,6 @@ namespace MediaBrowser.Controller.Library_stopwatch = new Stopwatch();_stopwatch.Start();}- #region IDisposable Members/// <summary>/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.@@ -71,7 +70,5 @@ namespace MediaBrowser.Controller.Library_logger.LogInformation(message);}}-- #endregion}}diff --git a/RSSDP/DeviceAvailableEventArgs.cs b/RSSDP/DeviceAvailableEventArgs.csindex 439cee4674..9c57471ca0 100644--- a/RSSDP/DeviceAvailableEventArgs.cs+++ b/RSSDP/DeviceAvailableEventArgs.cs@@ -10,14 +10,9 @@ namespace Rssdp{public IPAddress LocalIpAddress { get; set; }- #region Fields-private readonly DiscoveredSsdpDevice _DiscoveredDevice;- private readonly bool _IsNewlyDiscovered;- #endregion-- #region Constructors+ private readonly bool _IsNewlyDiscovered;/// <summary>/// Full constructor.@@ -33,10 +28,6 @@ namespace Rssdp_IsNewlyDiscovered = isNewlyDiscovered;}- #endregion-- #region Public Properties-/// <summary>/// Returns true if the device was discovered due to an alive notification, or a search and was not already in the cache. Returns false if the item came from the cache but matched the current search request./// </summary>@@ -52,7 +43,5 @@ namespace Rssdp{get { return _DiscoveredDevice; }}-- #endregion}}diff --git a/RSSDP/DeviceEventArgs.cs b/RSSDP/DeviceEventArgs.csindex faeff83476..b124527ca9 100644--- a/RSSDP/DeviceEventArgs.cs+++ b/RSSDP/DeviceEventArgs.cs@@ -7,15 +7,8 @@ namespace Rssdp/// </summary>public sealed class DeviceEventArgs : EventArgs{-- #region Fields-private readonly SsdpDevice _Device;- #endregion-- #region Constructors-/// <summary>/// Constructs a new instance for the specified <see cref="SsdpDevice"/>./// </summary>@@ -28,10 +21,6 @@ namespace Rssdp_Device = device;}- #endregion-- #region Public Properties-/// <summary>/// Returns the <see cref="SsdpDevice"/> instance the event being raised for./// </summary>@@ -39,7 +28,5 @@ namespace Rssdp{get { return _Device; }}-- #endregion}}diff --git a/RSSDP/DeviceUnavailableEventArgs.cs b/RSSDP/DeviceUnavailableEventArgs.csindex ef04904bdc..cee59268dc 100644--- a/RSSDP/DeviceUnavailableEventArgs.cs+++ b/RSSDP/DeviceUnavailableEventArgs.cs@@ -7,15 +7,9 @@ namespace Rssdp/// </summary>public sealed class DeviceUnavailableEventArgs : EventArgs{-- #region Fields-private readonly DiscoveredSsdpDevice _DiscoveredDevice;- private readonly bool _Expired;-- #endregion- #region Constructors+ private readonly bool _Expired;/// <summary>/// Full constructor.@@ -31,10 +25,6 @@ namespace Rssdp_Expired = expired;}- #endregion-- #region Public Properties-/// <summary>/// Returns true if the device is considered unavailable because it's cached information expired before a new alive notification or search result was received. Returns false if the device is unavailable because it sent an explicit notification of it's unavailability./// </summary>@@ -50,7 +40,5 @@ namespace Rssdp{get { return _DiscoveredDevice; }}-- #endregion}}diff --git a/RSSDP/DiscoveredSsdpDevice.cs b/RSSDP/DiscoveredSsdpDevice.csindex fb323c1fb3..322bd55e57 100644--- a/RSSDP/DiscoveredSsdpDevice.cs+++ b/RSSDP/DiscoveredSsdpDevice.cs@@ -10,15 +10,8 @@ namespace Rssdp/// <seealso cref="Infrastructure.ISsdpDeviceLocator"/>public sealed class DiscoveredSsdpDevice{-- #region Fields-private DateTimeOffset _AsAt;- #endregion-- #region Public Properties-/// <summary>/// Sets or returns the type of notification, being either a uuid, device type, service type or upnp:rootdevice./// </summary>@@ -60,10 +53,6 @@ namespace Rssdp/// </summary>public HttpHeaders ResponseHeaders { get; set; }- #endregion-- #region Public Methods-/// <summary>/// Returns true if this device information has expired, based on the current date/time, and the <see cref="CacheLifetime"/> & <see cref="AsAt"/> properties./// </summary>@@ -73,10 +62,6 @@ namespace Rssdpreturn this.CacheLifetime == TimeSpan.Zero || this.AsAt.Add(this.CacheLifetime) <= DateTimeOffset.Now;}- #endregion-- #region Overrides-/// <summary>/// Returns the device's <see cref="Usn"/> value./// </summary>@@ -85,7 +70,5 @@ namespace Rssdp{return this.Usn;}-- #endregion}}diff --git a/RSSDP/DisposableManagedObjectBase.cs b/RSSDP/DisposableManagedObjectBase.csindex 39589f0225..befa4ccffb 100644--- a/RSSDP/DisposableManagedObjectBase.cs+++ b/RSSDP/DisposableManagedObjectBase.cs@@ -9,9 +9,6 @@ namespace Rssdp.Infrastructure/// </summary>public abstract class DisposableManagedObjectBase : IDisposable{-- #region Public Methods-/// <summary>/// Override this method and dispose any objects you own the lifetime of if disposing is true;/// </summary>@@ -29,10 +26,6 @@ namespace Rssdp.Infrastructureif (this.IsDisposed) throw new ObjectDisposedException(this.GetType().FullName);}- #endregion-- #region Public Properties-/// <summary>/// Sets or returns a boolean indicating whether or not this instance has been disposed./// </summary>@@ -42,9 +35,6 @@ namespace Rssdp.Infrastructureget;private set;}-- #endregion-public string BuildMessage(string header, Dictionary<string, string> values){var builder = new StringBuilder();@@ -63,8 +53,6 @@ namespace Rssdp.Infrastructurereturn builder.ToString();}- #region IDisposable Members-/// <summary>/// Disposes this object instance and all internally managed resources./// </summary>@@ -79,7 +67,5 @@ namespace Rssdp.InfrastructureDispose(true);}-- #endregion}}diff --git a/RSSDP/HttpParserBase.cs b/RSSDP/HttpParserBase.csindex e7172cb1c0..ff97b6db84 100644--- a/RSSDP/HttpParserBase.cs+++ b/RSSDP/HttpParserBase.cs@@ -11,16 +11,9 @@ namespace Rssdp.Infrastructure/// <typeparam name="T"></typeparam>public abstract class HttpParserBase<T> where T : new(){-- #region Fields-private readonly string[] LineTerminators = new string[] { "\r\n", "\n" };private readonly char[] SeparatorCharacters = new char[] { ',', ';' };- #endregion-- #region Public Methods-/// <summary>/// Parses the <paramref name="data"/> provided into either a <see cref="HttpRequestMessage"/> or <see cref="HttpResponseMessage"/> object./// </summary>@@ -81,10 +74,6 @@ namespace Rssdp.Infrastructurereturn Version.Parse(versionData.Substring(versionSeparatorIndex + 1));}- #endregion-- #region Private Methods-/// <summary>/// Parses a line from an HTTP request or response message containing a header name and value pair./// </summary>@@ -202,8 +191,5 @@ namespace Rssdp.Infrastructureelsereturn trimmedSegment;}-- #endregion-}}diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.csindex 3fc328b8c1..31f042791d 100644--- a/RSSDP/HttpRequestParser.cs+++ b/RSSDP/HttpRequestParser.cs@@ -9,17 +9,10 @@ namespace Rssdp.Infrastructure/// </summary>public sealed class HttpRequestParser : HttpParserBase<HttpRequestMessage>{-- #region Fields & Constants-private readonly string[] ContentHeaderNames = new string[]- {- "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified"- };-- #endregion-- #region Public Methods+ {+ "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified"+ };/// <summary>/// Parses the specified data into a <see cref="HttpRequestMessage"/> instance.@@ -45,10 +38,6 @@ namespace Rssdp.Infrastructure}}- #endregion-- #region Overrides-/// <summary>/// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the <paramref name="message"/>./// </summary>@@ -83,7 +72,5 @@ namespace Rssdp.Infrastructure{return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase);}-- #endregion}}diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.csindex b96eaf625d..02c548d724 100644--- a/RSSDP/HttpResponseParser.cs+++ b/RSSDP/HttpResponseParser.cs@@ -10,17 +10,10 @@ namespace Rssdp.Infrastructure/// </summary>public sealed class HttpResponseParser : HttpParserBase<HttpResponseMessage>{-- #region Fields & Constants-private readonly string[] ContentHeaderNames = new string[]- {- "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified"- };-- #endregion-- #region Public Methods+ {+ "Allow", "Content-Disposition", "Content-Encoding", "Content-Language", "Content-Length", "Content-Location", "Content-MD5", "Content-Range", "Content-Type", "Expires", "Last-Modified"+ };/// <summary>/// Parses the specified data into a <see cref="HttpResponseMessage"/> instance.@@ -47,10 +40,6 @@ namespace Rssdp.Infrastructure}}- #endregion-- #region Overrides Methods-/// <summary>/// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false)./// </summary>@@ -87,7 +76,5 @@ namespace Rssdp.Infrastructuremessage.ReasonPhrase = parts[2].Trim();}}-- #endregion}}diff --git a/RSSDP/ISsdpCommunicationsServer.cs b/RSSDP/ISsdpCommunicationsServer.csindex 02c3af0e5e..aa35811ef1 100644--- a/RSSDP/ISsdpCommunicationsServer.cs+++ b/RSSDP/ISsdpCommunicationsServer.cs@@ -10,9 +10,6 @@ namespace Rssdp.Infrastructure/// </summary>public interface ISsdpCommunicationsServer : IDisposable{-- #region Events-/// <summary>/// Raised when a HTTPU request message is received by a socket (unicast or multicast)./// </summary>@@ -23,10 +20,6 @@ namespace Rssdp.Infrastructure/// </summary>event EventHandler<ResponseReceivedEventArgs> ResponseReceived;- #endregion-- #region Methods-/// <summary>/// Causes the server to begin listening for multicast messages, being SSDP search requests and notifications./// </summary>@@ -48,10 +41,6 @@ namespace Rssdp.InfrastructureTask SendMulticastMessage(string message, IPAddress fromLocalIpAddress, CancellationToken cancellationToken);Task SendMulticastMessage(string message, int sendCount, IPAddress fromLocalIpAddress, CancellationToken cancellationToken);- #endregion-- #region Properties-/// <summary>/// Gets or sets a boolean value indicating whether or not this instance is shared amongst multiple <see cref="SsdpDeviceLocatorBase"/> and/or <see cref="ISsdpDevicePublisher"/> instances./// </summary>@@ -59,7 +48,5 @@ namespace Rssdp.Infrastructure/// <para>If true, disposing an instance of a <see cref="SsdpDeviceLocatorBase"/>or a <see cref="ISsdpDevicePublisher"/> will not dispose this comms server instance. The calling code is responsible for managing the lifetime of the server.</para>/// </remarks>bool IsShared { get; set; }-- #endregion}}diff --git a/RSSDP/ISsdpDeviceLocator.cs b/RSSDP/ISsdpDeviceLocator.csindex 8f0d39e75a..4130556434 100644--- a/RSSDP/ISsdpDeviceLocator.cs+++ b/RSSDP/ISsdpDeviceLocator.cs@@ -13,9 +13,6 @@ namespace Rssdp.Infrastructure/// <seealso cref="ISsdpDevicePublisher"/>public interface ISsdpDeviceLocator{-- #region Events-/// <summary>/// Event raised when a device becomes available or is found by a search request./// </summary>@@ -34,10 +31,6 @@ namespace Rssdp.Infrastructure/// <seealso cref="StopListeningForNotifications"/>event EventHandler<DeviceUnavailableEventArgs> DeviceUnavailable;- #endregion-- #region Properties-/// <summary>/// Sets or returns a string containing the filter for notifications. Notifications not matching the filter will not raise the <see cref="DeviceAvailable"/> or <see cref="DeviceUnavailable"/> events./// </summary>@@ -58,12 +51,6 @@ namespace Rssdp.Infrastructureset;}- #endregion-- #region Methods-- #region SearchAsync Overloads-/// <summary>/// Aynchronously performs a search for all devices using the default search timeout, and returns an awaitable task that can be used to retrieve the results./// </summary>@@ -108,8 +95,6 @@ namespace Rssdp.Infrastructure/// <returns>A task whose result is an <see cref="System.Collections.Generic.IEnumerable{T}"/> of <see cref="DiscoveredSsdpDevice" /> instances, representing all found devices.</returns>System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<DiscoveredSsdpDevice>> SearchAsync(TimeSpan searchWaitTime);- #endregion-/// <summary>/// Starts listening for broadcast notifications of service availability./// </summary>@@ -134,8 +119,5 @@ namespace Rssdp.Infrastructure/// <seealso cref="DeviceUnavailable"/>/// <seealso cref="NotificationFilter"/>void StopListeningForNotifications();-- #endregion-}}diff --git a/RSSDP/RequestReceivedEventArgs.cs b/RSSDP/RequestReceivedEventArgs.csindex b753950f0a..025c4d2e0d 100644--- a/RSSDP/RequestReceivedEventArgs.cs+++ b/RSSDP/RequestReceivedEventArgs.cs@@ -9,17 +9,12 @@ namespace Rssdp.Infrastructure/// </summary>public sealed class RequestReceivedEventArgs : EventArgs{- #region Fields-private readonly HttpRequestMessage _Message;- private readonly IPEndPoint _ReceivedFrom;- #endregion+ private readonly IPEndPoint _ReceivedFrom;public IPAddress LocalIpAddress { get; private set; }- #region Constructors-/// <summary>/// Full constructor./// </summary>@@ -30,10 +25,6 @@ namespace Rssdp.InfrastructureLocalIpAddress = localIpAddress;}- #endregion-- #region Public Properties-/// <summary>/// The <see cref="HttpRequestMessage"/> that was received./// </summary>@@ -49,7 +40,5 @@ namespace Rssdp.Infrastructure{get { return _ReceivedFrom; }}-- #endregion}}diff --git a/RSSDP/ResponseReceivedEventArgs.cs b/RSSDP/ResponseReceivedEventArgs.csindex f9f9c3040c..708113da11 100644--- a/RSSDP/ResponseReceivedEventArgs.cs+++ b/RSSDP/ResponseReceivedEventArgs.cs@@ -9,17 +9,11 @@ namespace Rssdp.Infrastructure/// </summary>public sealed class ResponseReceivedEventArgs : EventArgs{-public IPAddress LocalIpAddress { get; set; }- #region Fields-private readonly HttpResponseMessage _Message;- private readonly IPEndPoint _ReceivedFrom;-- #endregion- #region Constructors+ private readonly IPEndPoint _ReceivedFrom;/// <summary>/// Full constructor.@@ -30,10 +24,6 @@ namespace Rssdp.Infrastructure_ReceivedFrom = receivedFrom;}- #endregion-- #region Public Properties-/// <summary>/// The <see cref="HttpResponseMessage"/> that was received./// </summary>@@ -49,7 +39,5 @@ namespace Rssdp.Infrastructure{get { return _ReceivedFrom; }}-- #endregion}}diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.csindex fe49fb7d36..12ecf24f3b 100644--- a/RSSDP/SsdpCommunicationsServer.cs+++ b/RSSDP/SsdpCommunicationsServer.cs@@ -19,9 +19,6 @@ namespace Rssdp.Infrastructure/// </summary>public sealed class SsdpCommunicationsServer : DisposableManagedObjectBase, ISsdpCommunicationsServer{-- #region Fields-/* We could technically use one socket listening on port 1900 for everything.* This should get both multicast (notifications) and unicast (search response) messages, however* this often doesn't work under Windows because the MS SSDP service is running. If that service@@ -55,10 +52,6 @@ namespace Rssdp.Infrastructureprivate bool _IsShared;private readonly bool _enableMultiSocketBinding;- #endregion-- #region Events-/// <summary>/// Raised when a HTTPU request message is received by a socket (unicast or multicast)./// </summary>@@ -69,10 +62,6 @@ namespace Rssdp.Infrastructure/// </summary>public event EventHandler<ResponseReceivedEventArgs> ResponseReceived;- #endregion-- #region Constructors-/// <summary>/// Minimum constructor./// </summary>@@ -109,10 +98,6 @@ namespace Rssdp.Infrastructure_enableMultiSocketBinding = enableMultiSocketBinding;}- #endregion-- #region Public Methods-/// <summary>/// Causes the server to begin listening for multicast messages, being SSDP search requests and notifications./// </summary>@@ -298,10 +283,6 @@ namespace Rssdp.Infrastructure}}- #endregion-- #region Public Properties-/// <summary>/// Gets or sets a boolean value indicating whether or not this instance is shared amongst multiple <see cref="SsdpDeviceLocatorBase"/> and/or <see cref="ISsdpDevicePublisher"/> instances./// </summary>@@ -315,10 +296,6 @@ namespace Rssdp.Infrastructureset { _IsShared = value; }}- #endregion-- #region Overrides-/// <summary>/// Stops listening for requests, disposes this instance and all internal resources./// </summary>@@ -333,10 +310,6 @@ namespace Rssdp.Infrastructure}}- #endregion-- #region Private Methods-private Task SendMessageIfSocketNotDisposed(byte[] messageData, IPEndPoint destination, IPAddress fromLocalIpAddress, CancellationToken cancellationToken){var sockets = _sendSockets;@@ -506,8 +479,5 @@ namespace Rssdp.InfrastructureLocalIpAddress = localIpAddress});}-- #endregion-}}diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.csindex f89bafb196..5b7d782b52 100644--- a/RSSDP/SsdpDevice.cs+++ b/RSSDP/SsdpDevice.cs@@ -15,9 +15,6 @@ namespace Rssdp/// <seealso cref="SsdpEmbeddedDevice"/>public abstract class SsdpDevice{-- #region Fields-private string _Udn;private string _DeviceType;private string _DeviceTypeNamespace;@@ -25,10 +22,6 @@ namespace Rssdpprivate IList<SsdpDevice> _Devices;- #endregion-- #region Events-/// <summary>/// Raised when a new child device is added./// </summary>@@ -43,10 +36,6 @@ namespace Rssdp/// <seealso cref="DeviceRemoved"/>public event EventHandler<DeviceEventArgs> DeviceRemoved;- #endregion-- #region Constructors-/// <summary>/// Derived type constructor, allows constructing a device with no parent. Should only be used from derived types that are or inherit from <see cref="SsdpRootDevice"/>./// </summary>@@ -60,8 +49,6 @@ namespace Rssdpthis.Devices = new ReadOnlyCollection<SsdpDevice>(_Devices);}- #endregion-public SsdpRootDevice ToRootDevice(){var device = this;@@ -73,10 +60,6 @@ namespace Rssdpreturn rootDevice;}- #region Public Properties-- #region UPnP Device Description Properties-/// <summary>/// Sets or returns the core device type (not including namespace, version etc.). Required./// </summary>@@ -252,8 +235,6 @@ namespace Rssdp/// </remarks>public Uri PresentationUrl { get; set; }- #endregion-/// <summary>/// Returns a read-only enumerable set of <see cref="SsdpDevice"/> objects representing children of this device. Child devices are optional./// </summary>@@ -265,10 +246,6 @@ namespace Rssdpprivate set;}- #endregion-- #region Public Methods-/// <summary>/// Adds a child device to the <see cref="Devices"/> collection./// </summary>@@ -351,7 +328,5 @@ namespace Rssdpif (handlers != null)handlers(this, new DeviceEventArgs(device));}-- #endregion}}diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.csindex 9b48cf31ce..b117c0b1e6 100644--- a/RSSDP/SsdpDeviceLocator.cs+++ b/RSSDP/SsdpDeviceLocator.cs@@ -13,9 +13,6 @@ namespace Rssdp.Infrastructure/// </summary>public class SsdpDeviceLocator : DisposableManagedObjectBase{-- #region Fields & Constants-private List<DiscoveredSsdpDevice> _Devices;private ISsdpCommunicationsServer _CommunicationsServer;@@ -25,10 +22,6 @@ namespace Rssdp.Infrastructureprivate readonly TimeSpan DefaultSearchWaitTime = TimeSpan.FromSeconds(4);private readonly TimeSpan OneSecond = TimeSpan.FromSeconds(1);- #endregion-- #region Constructors-/// <summary>/// Default constructor./// </summary>@@ -42,10 +35,6 @@ namespace Rssdp.Infrastructure_Devices = new List<DiscoveredSsdpDevice>();}- #endregion-- #region Events-/// <summary>/// Raised for when/// <list type="bullet">@@ -76,12 +65,6 @@ namespace Rssdp.Infrastructure/// <seealso cref="StopListeningForNotifications"/>public event EventHandler<DeviceUnavailableEventArgs> DeviceUnavailable;- #endregion-- #region Public Methods-- #region Search Overloads-public void RestartBroadcastTimer(TimeSpan dueTime, TimeSpan period){lock (_timerLock)@@ -167,8 +150,6 @@ namespace Rssdp.Infrastructurereturn BroadcastDiscoverMessage(searchTarget, SearchTimeToMXValue(searchWaitTime), cancellationToken);}- #endregion-/// <summary>/// Starts listening for broadcast notifications of service availability./// </summary>@@ -236,10 +217,6 @@ namespace Rssdp.Infrastructurehandlers(this, new DeviceUnavailableEventArgs(device, expired));}- #endregion-- #region Public Properties-/// <summary>/// Sets or returns a string containing the filter for notifications. Notifications not matching the filter will not raise the <see cref="ISsdpDeviceLocator.DeviceAvailable"/> or <see cref="ISsdpDeviceLocator.DeviceUnavailable"/> events./// </summary>@@ -261,10 +238,6 @@ namespace Rssdp.Infrastructureset;}- #endregion-- #region Overrides-/// <summary>/// Disposes this object and all internal resources. Stops listening for all network messages./// </summary>@@ -285,12 +258,6 @@ namespace Rssdp.Infrastructure}}- #endregion-- #region Private Methods-- #region Discovery/Device Add-private void AddOrUpdateDiscoveredDevice(DiscoveredSsdpDevice device, IPAddress localIpAddress){bool isNewDevice = false;@@ -326,10 +293,6 @@ namespace Rssdp.Infrastructure|| device.NotificationType == this.NotificationFilter;}- #endregion-- #region Network Message Processing-private Task BroadcastDiscoverMessage(string serviceType, TimeSpan mxValue, CancellationToken cancellationToken){var values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);@@ -429,8 +392,6 @@ namespace Rssdp.Infrastructure}}- #region Header/Message Processing Utilities-private string GetFirstHeaderStringValue(string headerName, HttpResponseMessage message){string retVal = null;@@ -498,12 +459,6 @@ namespace Rssdp.Infrastructurereturn (TimeSpan)(headerValue.MaxAge ?? headerValue.SharedMaxAge ?? TimeSpan.Zero);}- #endregion-- #endregion-- #region Expiry and Device Removal-private void RemoveExpiredDevicesFromCache(){if (this.IsDisposed) return;@@ -560,8 +515,6 @@ namespace Rssdp.Infrastructurereturn false;}- #endregion-private TimeSpan SearchTimeToMXValue(TimeSpan searchWaitTime){if (searchWaitTime.TotalSeconds < 2 || searchWaitTime == TimeSpan.Zero)@@ -598,10 +551,6 @@ namespace Rssdp.Infrastructurereturn list;}- #endregion-- #region Event Handlers-private void CommsServer_ResponseReceived(object sender, ResponseReceivedEventArgs e){ProcessSearchResponseMessage(e.Message, e.LocalIpAddress);@@ -611,7 +560,5 @@ namespace Rssdp.Infrastructure{ProcessNotificationMessage(e.Message, e.LocalIpAddress);}-- #endregion}}diff --git a/RSSDP/SsdpEmbeddedDevice.cs b/RSSDP/SsdpEmbeddedDevice.csindex ff644993b5..f1a5981118 100644--- a/RSSDP/SsdpEmbeddedDevice.cs+++ b/RSSDP/SsdpEmbeddedDevice.cs@@ -5,14 +5,8 @@ namespace Rssdp/// </summary>public class SsdpEmbeddedDevice : SsdpDevice{-- #region Fieldsprivate SsdpRootDevice _RootDevice;- #endregion-- #region Constructors-/// <summary>/// Default constructor./// </summary>@@ -20,10 +14,6 @@ namespace Rssdp{}- #endregion-- #region Public Properties-/// <summary>/// Returns the <see cref="SsdpRootDevice"/> that is this device's first ancestor. If this device is itself an <see cref="SsdpRootDevice"/>, then returns a reference to itself./// </summary>@@ -46,7 +36,5 @@ namespace Rssdp}}}-- #endregion}}diff --git a/RSSDP/SsdpRootDevice.cs b/RSSDP/SsdpRootDevice.csindex 0f2de7b156..8937ec331f 100644--- a/RSSDP/SsdpRootDevice.cs+++ b/RSSDP/SsdpRootDevice.cs@@ -12,14 +12,8 @@ namespace Rssdp/// </remarks>public class SsdpRootDevice : SsdpDevice{- #region Fields-private Uri _UrlBase;- #endregion-- #region Constructors-/// <summary>/// Default constructor./// </summary>@@ -27,10 +21,6 @@ namespace Rssdp{}- #endregion-- #region Public Properties-/// <summary>/// Specifies how long clients can cache this device's details for. Optional but defaults to <see cref="TimeSpan.Zero"/> which means no-caching. Recommended value is half an hour./// </summary>@@ -77,7 +67,5 @@ namespace Rssdp_UrlBase = value;}}-- #endregion}}