From 8e3d8748021fe0336e2fc1211810cc9bbe2c8850 Mon Sep 17 00:00:00 2001 From: telans Date: Sat, 20 Jun 2020 18:20:33 +1200 Subject: [PATCH] remove regions --- Emby.Dlna/PlayTo/Device.cs | 23 ++------ .../Library/ItemResolveArgs.cs | 5 -- MediaBrowser.Controller/Library/Profiler.cs | 3 -- RSSDP/DeviceAvailableEventArgs.cs | 13 +---- RSSDP/DeviceEventArgs.cs | 13 ----- RSSDP/DeviceUnavailableEventArgs.cs | 14 +---- RSSDP/DiscoveredSsdpDevice.cs | 17 ------ RSSDP/DisposableManagedObjectBase.cs | 14 ----- RSSDP/HttpParserBase.cs | 14 ----- RSSDP/HttpRequestParser.cs | 19 ++----- RSSDP/HttpResponseParser.cs | 19 ++----- RSSDP/ISsdpCommunicationsServer.cs | 13 ----- RSSDP/ISsdpDeviceLocator.cs | 18 ------- RSSDP/RequestReceivedEventArgs.cs | 13 +---- RSSDP/ResponseReceivedEventArgs.cs | 14 +---- RSSDP/SsdpCommunicationsServer.cs | 30 ----------- RSSDP/SsdpDevice.cs | 25 --------- RSSDP/SsdpDeviceLocator.cs | 53 ------------------- RSSDP/SsdpEmbeddedDevice.cs | 12 ----- RSSDP/SsdpRootDevice.cs | 12 ----- 20 files changed, 13 insertions(+), 331 deletions(-) diff --git a/Emby.Dlna/PlayTo/Device.cs b/Emby.Dlna/PlayTo/Device.cs index 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.PlayTo public 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.PlayTo RestartTimer(true); } - #endregion - - #region Get data - private int _connectFailureCount; + private async void TimerCallback(object sender) { if (_disposed) @@ -870,10 +863,6 @@ namespace Emby.Dlna.PlayTo return new string[4]; } - #endregion - - #region From XML - private async Task GetAVProtocolAsync(CancellationToken cancellationToken) { if (AvCommands != null) @@ -1068,8 +1057,6 @@ namespace Emby.Dlna.PlayTo return 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.cs index 1516bb1e9b..731c6d6674 100644 --- a/MediaBrowser.Controller/Library/ItemResolveArgs.cs +++ b/MediaBrowser.Controller/Library/ItemResolveArgs.cs @@ -224,8 +224,6 @@ namespace MediaBrowser.Controller.Library public string CollectionType { get; set; } - #region Equality Overrides - /// /// Determines whether the specified is equal to this instance. /// @@ -260,8 +258,5 @@ namespace MediaBrowser.Controller.Library return false; } - - #endregion } - } diff --git a/MediaBrowser.Controller/Library/Profiler.cs b/MediaBrowser.Controller/Library/Profiler.cs index 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 /// /// 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.cs index 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; /// /// Full constructor. @@ -33,10 +28,6 @@ namespace Rssdp _IsNewlyDiscovered = isNewlyDiscovered; } - #endregion - - #region Public Properties - /// /// 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. /// @@ -52,7 +43,5 @@ namespace Rssdp { get { return _DiscoveredDevice; } } - - #endregion } } diff --git a/RSSDP/DeviceEventArgs.cs b/RSSDP/DeviceEventArgs.cs index faeff83476..b124527ca9 100644 --- a/RSSDP/DeviceEventArgs.cs +++ b/RSSDP/DeviceEventArgs.cs @@ -7,15 +7,8 @@ namespace Rssdp /// public sealed class DeviceEventArgs : EventArgs { - - #region Fields - private readonly SsdpDevice _Device; - #endregion - - #region Constructors - /// /// Constructs a new instance for the specified . /// @@ -28,10 +21,6 @@ namespace Rssdp _Device = device; } - #endregion - - #region Public Properties - /// /// Returns the instance the event being raised for. /// @@ -39,7 +28,5 @@ namespace Rssdp { get { return _Device; } } - - #endregion } } diff --git a/RSSDP/DeviceUnavailableEventArgs.cs b/RSSDP/DeviceUnavailableEventArgs.cs index ef04904bdc..cee59268dc 100644 --- a/RSSDP/DeviceUnavailableEventArgs.cs +++ b/RSSDP/DeviceUnavailableEventArgs.cs @@ -7,15 +7,9 @@ namespace Rssdp /// public sealed class DeviceUnavailableEventArgs : EventArgs { - - #region Fields - private readonly DiscoveredSsdpDevice _DiscoveredDevice; - private readonly bool _Expired; - - #endregion - #region Constructors + private readonly bool _Expired; /// /// Full constructor. @@ -31,10 +25,6 @@ namespace Rssdp _Expired = expired; } - #endregion - - #region Public Properties - /// /// 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. /// @@ -50,7 +40,5 @@ namespace Rssdp { get { return _DiscoveredDevice; } } - - #endregion } } diff --git a/RSSDP/DiscoveredSsdpDevice.cs b/RSSDP/DiscoveredSsdpDevice.cs index fb323c1fb3..322bd55e57 100644 --- a/RSSDP/DiscoveredSsdpDevice.cs +++ b/RSSDP/DiscoveredSsdpDevice.cs @@ -10,15 +10,8 @@ namespace Rssdp /// public sealed class DiscoveredSsdpDevice { - - #region Fields - private DateTimeOffset _AsAt; - #endregion - - #region Public Properties - /// /// Sets or returns the type of notification, being either a uuid, device type, service type or upnp:rootdevice. /// @@ -60,10 +53,6 @@ namespace Rssdp /// public HttpHeaders ResponseHeaders { get; set; } - #endregion - - #region Public Methods - /// /// Returns true if this device information has expired, based on the current date/time, and the & properties. /// @@ -73,10 +62,6 @@ namespace Rssdp return this.CacheLifetime == TimeSpan.Zero || this.AsAt.Add(this.CacheLifetime) <= DateTimeOffset.Now; } - #endregion - - #region Overrides - /// /// Returns the device's value. /// @@ -85,7 +70,5 @@ namespace Rssdp { return this.Usn; } - - #endregion } } diff --git a/RSSDP/DisposableManagedObjectBase.cs b/RSSDP/DisposableManagedObjectBase.cs index 39589f0225..befa4ccffb 100644 --- a/RSSDP/DisposableManagedObjectBase.cs +++ b/RSSDP/DisposableManagedObjectBase.cs @@ -9,9 +9,6 @@ namespace Rssdp.Infrastructure /// public abstract class DisposableManagedObjectBase : IDisposable { - - #region Public Methods - /// /// Override this method and dispose any objects you own the lifetime of if disposing is true; /// @@ -29,10 +26,6 @@ namespace Rssdp.Infrastructure if (this.IsDisposed) throw new ObjectDisposedException(this.GetType().FullName); } - #endregion - - #region Public Properties - /// /// Sets or returns a boolean indicating whether or not this instance has been disposed. /// @@ -42,9 +35,6 @@ namespace Rssdp.Infrastructure get; private set; } - - #endregion - public string BuildMessage(string header, Dictionary values) { var builder = new StringBuilder(); @@ -63,8 +53,6 @@ namespace Rssdp.Infrastructure return builder.ToString(); } - #region IDisposable Members - /// /// Disposes this object instance and all internally managed resources. /// @@ -79,7 +67,5 @@ namespace Rssdp.Infrastructure Dispose(true); } - - #endregion } } diff --git a/RSSDP/HttpParserBase.cs b/RSSDP/HttpParserBase.cs index e7172cb1c0..ff97b6db84 100644 --- a/RSSDP/HttpParserBase.cs +++ b/RSSDP/HttpParserBase.cs @@ -11,16 +11,9 @@ namespace Rssdp.Infrastructure /// public abstract class HttpParserBase where T : new() { - - #region Fields - private readonly string[] LineTerminators = new string[] { "\r\n", "\n" }; private readonly char[] SeparatorCharacters = new char[] { ',', ';' }; - #endregion - - #region Public Methods - /// /// Parses the provided into either a or object. /// @@ -81,10 +74,6 @@ namespace Rssdp.Infrastructure return Version.Parse(versionData.Substring(versionSeparatorIndex + 1)); } - #endregion - - #region Private Methods - /// /// Parses a line from an HTTP request or response message containing a header name and value pair. /// @@ -202,8 +191,5 @@ namespace Rssdp.Infrastructure else return trimmedSegment; } - - #endregion - } } diff --git a/RSSDP/HttpRequestParser.cs b/RSSDP/HttpRequestParser.cs index 3fc328b8c1..31f042791d 100644 --- a/RSSDP/HttpRequestParser.cs +++ b/RSSDP/HttpRequestParser.cs @@ -9,17 +9,10 @@ namespace Rssdp.Infrastructure /// public sealed class HttpRequestParser : HttpParserBase { - - #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" + }; /// /// Parses the specified data into a instance. @@ -45,10 +38,6 @@ namespace Rssdp.Infrastructure } } - #endregion - - #region Overrides - /// /// Used to parse the first line of an HTTP request or response and assign the values to the appropriate properties on the . /// @@ -83,7 +72,5 @@ namespace Rssdp.Infrastructure { return ContentHeaderNames.Contains(headerName, StringComparer.OrdinalIgnoreCase); } - - #endregion } } diff --git a/RSSDP/HttpResponseParser.cs b/RSSDP/HttpResponseParser.cs index b96eaf625d..02c548d724 100644 --- a/RSSDP/HttpResponseParser.cs +++ b/RSSDP/HttpResponseParser.cs @@ -10,17 +10,10 @@ namespace Rssdp.Infrastructure /// public sealed class HttpResponseParser : HttpParserBase { - - #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" + }; /// /// Parses the specified data into a instance. @@ -47,10 +40,6 @@ namespace Rssdp.Infrastructure } } - #endregion - - #region Overrides Methods - /// /// Returns a boolean indicating whether the specified HTTP header name represents a content header (true), or a message header (false). /// @@ -87,7 +76,5 @@ namespace Rssdp.Infrastructure message.ReasonPhrase = parts[2].Trim(); } } - - #endregion } } diff --git a/RSSDP/ISsdpCommunicationsServer.cs b/RSSDP/ISsdpCommunicationsServer.cs index 02c3af0e5e..aa35811ef1 100644 --- a/RSSDP/ISsdpCommunicationsServer.cs +++ b/RSSDP/ISsdpCommunicationsServer.cs @@ -10,9 +10,6 @@ namespace Rssdp.Infrastructure /// public interface ISsdpCommunicationsServer : IDisposable { - - #region Events - /// /// Raised when a HTTPU request message is received by a socket (unicast or multicast). /// @@ -23,10 +20,6 @@ namespace Rssdp.Infrastructure /// event EventHandler ResponseReceived; - #endregion - - #region Methods - /// /// Causes the server to begin listening for multicast messages, being SSDP search requests and notifications. /// @@ -48,10 +41,6 @@ namespace Rssdp.Infrastructure Task SendMulticastMessage(string message, IPAddress fromLocalIpAddress, CancellationToken cancellationToken); Task SendMulticastMessage(string message, int sendCount, IPAddress fromLocalIpAddress, CancellationToken cancellationToken); - #endregion - - #region Properties - /// /// Gets or sets a boolean value indicating whether or not this instance is shared amongst multiple and/or instances. /// @@ -59,7 +48,5 @@ namespace Rssdp.Infrastructure /// If true, disposing an instance of a or a will not dispose this comms server instance. The calling code is responsible for managing the lifetime of the server. /// bool IsShared { get; set; } - - #endregion } } diff --git a/RSSDP/ISsdpDeviceLocator.cs b/RSSDP/ISsdpDeviceLocator.cs index 8f0d39e75a..4130556434 100644 --- a/RSSDP/ISsdpDeviceLocator.cs +++ b/RSSDP/ISsdpDeviceLocator.cs @@ -13,9 +13,6 @@ namespace Rssdp.Infrastructure /// public interface ISsdpDeviceLocator { - - #region Events - /// /// Event raised when a device becomes available or is found by a search request. /// @@ -34,10 +31,6 @@ namespace Rssdp.Infrastructure /// event EventHandler DeviceUnavailable; - #endregion - - #region Properties - /// /// Sets or returns a string containing the filter for notifications. Notifications not matching the filter will not raise the or events. /// @@ -58,12 +51,6 @@ namespace Rssdp.Infrastructure set; } - #endregion - - #region Methods - - #region SearchAsync Overloads - /// /// 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. /// @@ -108,8 +95,6 @@ namespace Rssdp.Infrastructure /// A task whose result is an of instances, representing all found devices. System.Threading.Tasks.Task> SearchAsync(TimeSpan searchWaitTime); - #endregion - /// /// Starts listening for broadcast notifications of service availability. /// @@ -134,8 +119,5 @@ namespace Rssdp.Infrastructure /// /// void StopListeningForNotifications(); - - #endregion - } } diff --git a/RSSDP/RequestReceivedEventArgs.cs b/RSSDP/RequestReceivedEventArgs.cs index b753950f0a..025c4d2e0d 100644 --- a/RSSDP/RequestReceivedEventArgs.cs +++ b/RSSDP/RequestReceivedEventArgs.cs @@ -9,17 +9,12 @@ namespace Rssdp.Infrastructure /// 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 - /// /// Full constructor. /// @@ -30,10 +25,6 @@ namespace Rssdp.Infrastructure LocalIpAddress = localIpAddress; } - #endregion - - #region Public Properties - /// /// The that was received. /// @@ -49,7 +40,5 @@ namespace Rssdp.Infrastructure { get { return _ReceivedFrom; } } - - #endregion } } diff --git a/RSSDP/ResponseReceivedEventArgs.cs b/RSSDP/ResponseReceivedEventArgs.cs index f9f9c3040c..708113da11 100644 --- a/RSSDP/ResponseReceivedEventArgs.cs +++ b/RSSDP/ResponseReceivedEventArgs.cs @@ -9,17 +9,11 @@ namespace Rssdp.Infrastructure /// 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; /// /// Full constructor. @@ -30,10 +24,6 @@ namespace Rssdp.Infrastructure _ReceivedFrom = receivedFrom; } - #endregion - - #region Public Properties - /// /// The that was received. /// @@ -49,7 +39,5 @@ namespace Rssdp.Infrastructure { get { return _ReceivedFrom; } } - - #endregion } } diff --git a/RSSDP/SsdpCommunicationsServer.cs b/RSSDP/SsdpCommunicationsServer.cs index fe49fb7d36..12ecf24f3b 100644 --- a/RSSDP/SsdpCommunicationsServer.cs +++ b/RSSDP/SsdpCommunicationsServer.cs @@ -19,9 +19,6 @@ namespace Rssdp.Infrastructure /// 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.Infrastructure private bool _IsShared; private readonly bool _enableMultiSocketBinding; - #endregion - - #region Events - /// /// Raised when a HTTPU request message is received by a socket (unicast or multicast). /// @@ -69,10 +62,6 @@ namespace Rssdp.Infrastructure /// public event EventHandler ResponseReceived; - #endregion - - #region Constructors - /// /// Minimum constructor. /// @@ -109,10 +98,6 @@ namespace Rssdp.Infrastructure _enableMultiSocketBinding = enableMultiSocketBinding; } - #endregion - - #region Public Methods - /// /// Causes the server to begin listening for multicast messages, being SSDP search requests and notifications. /// @@ -298,10 +283,6 @@ namespace Rssdp.Infrastructure } } - #endregion - - #region Public Properties - /// /// Gets or sets a boolean value indicating whether or not this instance is shared amongst multiple and/or instances. /// @@ -315,10 +296,6 @@ namespace Rssdp.Infrastructure set { _IsShared = value; } } - #endregion - - #region Overrides - /// /// Stops listening for requests, disposes this instance and all internal resources. /// @@ -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.Infrastructure LocalIpAddress = localIpAddress }); } - - #endregion - } } diff --git a/RSSDP/SsdpDevice.cs b/RSSDP/SsdpDevice.cs index f89bafb196..5b7d782b52 100644 --- a/RSSDP/SsdpDevice.cs +++ b/RSSDP/SsdpDevice.cs @@ -15,9 +15,6 @@ namespace Rssdp /// public abstract class SsdpDevice { - - #region Fields - private string _Udn; private string _DeviceType; private string _DeviceTypeNamespace; @@ -25,10 +22,6 @@ namespace Rssdp private IList _Devices; - #endregion - - #region Events - /// /// Raised when a new child device is added. /// @@ -43,10 +36,6 @@ namespace Rssdp /// public event EventHandler DeviceRemoved; - #endregion - - #region Constructors - /// /// Derived type constructor, allows constructing a device with no parent. Should only be used from derived types that are or inherit from . /// @@ -60,8 +49,6 @@ namespace Rssdp this.Devices = new ReadOnlyCollection(_Devices); } - #endregion - public SsdpRootDevice ToRootDevice() { var device = this; @@ -73,10 +60,6 @@ namespace Rssdp return rootDevice; } - #region Public Properties - - #region UPnP Device Description Properties - /// /// Sets or returns the core device type (not including namespace, version etc.). Required. /// @@ -252,8 +235,6 @@ namespace Rssdp /// public Uri PresentationUrl { get; set; } - #endregion - /// /// Returns a read-only enumerable set of objects representing children of this device. Child devices are optional. /// @@ -265,10 +246,6 @@ namespace Rssdp private set; } - #endregion - - #region Public Methods - /// /// Adds a child device to the collection. /// @@ -351,7 +328,5 @@ namespace Rssdp if (handlers != null) handlers(this, new DeviceEventArgs(device)); } - - #endregion } } diff --git a/RSSDP/SsdpDeviceLocator.cs b/RSSDP/SsdpDeviceLocator.cs index 9b48cf31ce..b117c0b1e6 100644 --- a/RSSDP/SsdpDeviceLocator.cs +++ b/RSSDP/SsdpDeviceLocator.cs @@ -13,9 +13,6 @@ namespace Rssdp.Infrastructure /// public class SsdpDeviceLocator : DisposableManagedObjectBase { - - #region Fields & Constants - private List _Devices; private ISsdpCommunicationsServer _CommunicationsServer; @@ -25,10 +22,6 @@ namespace Rssdp.Infrastructure private readonly TimeSpan DefaultSearchWaitTime = TimeSpan.FromSeconds(4); private readonly TimeSpan OneSecond = TimeSpan.FromSeconds(1); - #endregion - - #region Constructors - /// /// Default constructor. /// @@ -42,10 +35,6 @@ namespace Rssdp.Infrastructure _Devices = new List(); } - #endregion - - #region Events - /// /// Raised for when /// @@ -76,12 +65,6 @@ namespace Rssdp.Infrastructure /// public event EventHandler DeviceUnavailable; - #endregion - - #region Public Methods - - #region Search Overloads - public void RestartBroadcastTimer(TimeSpan dueTime, TimeSpan period) { lock (_timerLock) @@ -167,8 +150,6 @@ namespace Rssdp.Infrastructure return BroadcastDiscoverMessage(searchTarget, SearchTimeToMXValue(searchWaitTime), cancellationToken); } - #endregion - /// /// Starts listening for broadcast notifications of service availability. /// @@ -236,10 +217,6 @@ namespace Rssdp.Infrastructure handlers(this, new DeviceUnavailableEventArgs(device, expired)); } - #endregion - - #region Public Properties - /// /// Sets or returns a string containing the filter for notifications. Notifications not matching the filter will not raise the or events. /// @@ -261,10 +238,6 @@ namespace Rssdp.Infrastructure set; } - #endregion - - #region Overrides - /// /// Disposes this object and all internal resources. Stops listening for all network messages. /// @@ -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(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.Infrastructure return (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.Infrastructure return false; } - #endregion - private TimeSpan SearchTimeToMXValue(TimeSpan searchWaitTime) { if (searchWaitTime.TotalSeconds < 2 || searchWaitTime == TimeSpan.Zero) @@ -598,10 +551,6 @@ namespace Rssdp.Infrastructure return 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.cs index ff644993b5..f1a5981118 100644 --- a/RSSDP/SsdpEmbeddedDevice.cs +++ b/RSSDP/SsdpEmbeddedDevice.cs @@ -5,14 +5,8 @@ namespace Rssdp /// public class SsdpEmbeddedDevice : SsdpDevice { - - #region Fields private SsdpRootDevice _RootDevice; - #endregion - - #region Constructors - /// /// Default constructor. /// @@ -20,10 +14,6 @@ namespace Rssdp { } - #endregion - - #region Public Properties - /// /// Returns the that is this device's first ancestor. If this device is itself an , then returns a reference to itself. /// @@ -46,7 +36,5 @@ namespace Rssdp } } } - - #endregion } } diff --git a/RSSDP/SsdpRootDevice.cs b/RSSDP/SsdpRootDevice.cs index 0f2de7b156..8937ec331f 100644 --- a/RSSDP/SsdpRootDevice.cs +++ b/RSSDP/SsdpRootDevice.cs @@ -12,14 +12,8 @@ namespace Rssdp /// public class SsdpRootDevice : SsdpDevice { - #region Fields - private Uri _UrlBase; - #endregion - - #region Constructors - /// /// Default constructor. /// @@ -27,10 +21,6 @@ namespace Rssdp { } - #endregion - - #region Public Properties - /// /// Specifies how long clients can cache this device's details for. Optional but defaults to which means no-caching. Recommended value is half an hour. /// @@ -77,7 +67,5 @@ namespace Rssdp _UrlBase = value; } } - - #endregion } }