aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Common
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2020-06-03 13:04:45 +0200
committerBond-009 <bond.009@outlook.com>2020-06-03 13:04:45 +0200
commitf404e915eeef6cc9b05c6d006569b6d3a3e54eee (patch)
tree30f3de8d2f494bfc1c42f262d17096105062cb11 /MediaBrowser.Common
parent40502a33e0f0e3c84487be6d3eff2be35c1448ad (diff)
Enable StyleCop for MediaBrowser.Common
Diffstat (limited to 'MediaBrowser.Common')
-rw-r--r--MediaBrowser.Common/Configuration/ConfigurationStore.cs20
-rw-r--r--MediaBrowser.Common/Configuration/IApplicationPaths.cs22
-rw-r--r--MediaBrowser.Common/Configuration/IConfigurationFactory.cs30
-rw-r--r--MediaBrowser.Common/Configuration/IConfigurationManager.cs2
-rw-r--r--MediaBrowser.Common/Configuration/IValidatingConfiguration.cs15
-rw-r--r--MediaBrowser.Common/MediaBrowser.Common.csproj2
-rw-r--r--MediaBrowser.Common/Net/CacheMode.cs11
-rw-r--r--MediaBrowser.Common/Net/CompressionMethods.cs15
-rw-r--r--MediaBrowser.Common/Net/HttpRequestOptions.cs14
-rw-r--r--MediaBrowser.Common/Progress/ActionableProgress.cs17
-rw-r--r--MediaBrowser.Common/Progress/SimpleProgress.cs16
11 files changed, 94 insertions, 70 deletions
diff --git a/MediaBrowser.Common/Configuration/ConfigurationStore.cs b/MediaBrowser.Common/Configuration/ConfigurationStore.cs
new file mode 100644
index 000000000..d31d45e4c
--- /dev/null
+++ b/MediaBrowser.Common/Configuration/ConfigurationStore.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace MediaBrowser.Common.Configuration
+{
+ /// <summary>
+ /// Describes a single entry in the application configuration.
+ /// </summary>
+ public class ConfigurationStore
+ {
+ /// <summary>
+ /// Gets or sets the unique identifier for the configuration.
+ /// </summary>
+ public string Key { get; set; }
+
+ /// <summary>
+ /// Gets or sets the type used to store the data for this configuration entry.
+ /// </summary>
+ public Type ConfigurationType { get; set; }
+ }
+}
diff --git a/MediaBrowser.Common/Configuration/IApplicationPaths.cs b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
index 870b90796..4cea61682 100644
--- a/MediaBrowser.Common/Configuration/IApplicationPaths.cs
+++ b/MediaBrowser.Common/Configuration/IApplicationPaths.cs
@@ -3,12 +3,12 @@ using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Common.Configuration
{
/// <summary>
- /// Interface IApplicationPaths
+ /// Interface IApplicationPaths.
/// </summary>
public interface IApplicationPaths
{
/// <summary>
- /// Gets the path to the program data folder
+ /// Gets the path to the program data folder.
/// </summary>
/// <value>The program data path.</value>
string ProgramDataPath { get; }
@@ -23,13 +23,13 @@ namespace MediaBrowser.Common.Configuration
string WebPath { get; }
/// <summary>
- /// Gets the path to the program system folder
+ /// Gets the path to the program system folder.
/// </summary>
/// <value>The program data path.</value>
string ProgramSystemPath { get; }
/// <summary>
- /// Gets the folder path to the data directory
+ /// Gets the folder path to the data directory.
/// </summary>
/// <value>The data directory.</value>
string DataPath { get; }
@@ -41,43 +41,43 @@ namespace MediaBrowser.Common.Configuration
string ImageCachePath { get; }
/// <summary>
- /// Gets the path to the plugin directory
+ /// Gets the path to the plugin directory.
/// </summary>
/// <value>The plugins path.</value>
string PluginsPath { get; }
/// <summary>
- /// Gets the path to the plugin configurations directory
+ /// Gets the path to the plugin configurations directory.
/// </summary>
/// <value>The plugin configurations path.</value>
string PluginConfigurationsPath { get; }
/// <summary>
- /// Gets the path to the log directory
+ /// Gets the path to the log directory.
/// </summary>
/// <value>The log directory path.</value>
string LogDirectoryPath { get; }
/// <summary>
- /// Gets the path to the application configuration root directory
+ /// Gets the path to the application configuration root directory.
/// </summary>
/// <value>The configuration directory path.</value>
string ConfigurationDirectoryPath { get; }
/// <summary>
- /// Gets the path to the system configuration file
+ /// Gets the path to the system configuration file.
/// </summary>
/// <value>The system configuration file path.</value>
string SystemConfigurationFilePath { get; }
/// <summary>
- /// Gets the folder path to the cache directory
+ /// Gets the folder path to the cache directory.
/// </summary>
/// <value>The cache directory.</value>
string CachePath { get; }
/// <summary>
- /// Gets the folder path to the temp directory within the cache folder
+ /// Gets the folder path to the temp directory within the cache folder.
/// </summary>
/// <value>The temp directory.</value>
string TempDirectory { get; }
diff --git a/MediaBrowser.Common/Configuration/IConfigurationFactory.cs b/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
index 07ca2b58b..6db1f1364 100644
--- a/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
+++ b/MediaBrowser.Common/Configuration/IConfigurationFactory.cs
@@ -1,4 +1,3 @@
-using System;
using System.Collections.Generic;
namespace MediaBrowser.Common.Configuration
@@ -15,33 +14,4 @@ namespace MediaBrowser.Common.Configuration
/// <returns>The configuration store.</returns>
IEnumerable<ConfigurationStore> GetConfigurations();
}
-
- /// <summary>
- /// Describes a single entry in the application configuration.
- /// </summary>
- public class ConfigurationStore
- {
- /// <summary>
- /// Gets or sets the unique identifier for the configuration.
- /// </summary>
- public string Key { get; set; }
-
- /// <summary>
- /// Gets or sets the type used to store the data for this configuration entry.
- /// </summary>
- public Type ConfigurationType { get; set; }
- }
-
- /// <summary>
- /// A configuration store that can be validated.
- /// </summary>
- public interface IValidatingConfiguration
- {
- /// <summary>
- /// Validation method to be invoked before saving the configuration.
- /// </summary>
- /// <param name="oldConfig">The old configuration.</param>
- /// <param name="newConfig">The new configuration.</param>
- void Validate(object oldConfig, object newConfig);
- }
}
diff --git a/MediaBrowser.Common/Configuration/IConfigurationManager.cs b/MediaBrowser.Common/Configuration/IConfigurationManager.cs
index caf2edd83..fe726090d 100644
--- a/MediaBrowser.Common/Configuration/IConfigurationManager.cs
+++ b/MediaBrowser.Common/Configuration/IConfigurationManager.cs
@@ -24,7 +24,7 @@ namespace MediaBrowser.Common.Configuration
event EventHandler<ConfigurationUpdateEventArgs> NamedConfigurationUpdated;
/// <summary>
- /// Gets or sets the application paths.
+ /// Gets the application paths.
/// </summary>
/// <value>The application paths.</value>
IApplicationPaths CommonApplicationPaths { get; }
diff --git a/MediaBrowser.Common/Configuration/IValidatingConfiguration.cs b/MediaBrowser.Common/Configuration/IValidatingConfiguration.cs
new file mode 100644
index 000000000..3b1d84f3c
--- /dev/null
+++ b/MediaBrowser.Common/Configuration/IValidatingConfiguration.cs
@@ -0,0 +1,15 @@
+namespace MediaBrowser.Common.Configuration
+{
+ /// <summary>
+ /// A configuration store that can be validated.
+ /// </summary>
+ public interface IValidatingConfiguration
+ {
+ /// <summary>
+ /// Validation method to be invoked before saving the configuration.
+ /// </summary>
+ /// <param name="oldConfig">The old configuration.</param>
+ /// <param name="newConfig">The new configuration.</param>
+ void Validate(object oldConfig, object newConfig);
+ }
+}
diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj
index a597b9052..0713b83b7 100644
--- a/MediaBrowser.Common/MediaBrowser.Common.csproj
+++ b/MediaBrowser.Common/MediaBrowser.Common.csproj
@@ -37,7 +37,7 @@
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
- <!-- <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" /> -->
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>
diff --git a/MediaBrowser.Common/Net/CacheMode.cs b/MediaBrowser.Common/Net/CacheMode.cs
new file mode 100644
index 000000000..78fa3bf9b
--- /dev/null
+++ b/MediaBrowser.Common/Net/CacheMode.cs
@@ -0,0 +1,11 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1602
+
+namespace MediaBrowser.Common.Net
+{
+ public enum CacheMode
+ {
+ None = 0,
+ Unconditional = 1
+ }
+}
diff --git a/MediaBrowser.Common/Net/CompressionMethods.cs b/MediaBrowser.Common/Net/CompressionMethods.cs
new file mode 100644
index 000000000..39b72609f
--- /dev/null
+++ b/MediaBrowser.Common/Net/CompressionMethods.cs
@@ -0,0 +1,15 @@
+#pragma warning disable CS1591
+#pragma warning disable SA1602
+
+using System;
+
+namespace MediaBrowser.Common.Net
+{
+ [Flags]
+ public enum CompressionMethods
+ {
+ None = 0b00000001,
+ Deflate = 0b00000010,
+ Gzip = 0b00000100
+ }
+}
diff --git a/MediaBrowser.Common/Net/HttpRequestOptions.cs b/MediaBrowser.Common/Net/HttpRequestOptions.cs
index 38274a80e..347fc9833 100644
--- a/MediaBrowser.Common/Net/HttpRequestOptions.cs
+++ b/MediaBrowser.Common/Net/HttpRequestOptions.cs
@@ -102,18 +102,4 @@ namespace MediaBrowser.Common.Net
return value;
}
}
-
- public enum CacheMode
- {
- None = 0,
- Unconditional = 1
- }
-
- [Flags]
- public enum CompressionMethods
- {
- None = 0b00000001,
- Deflate = 0b00000010,
- Gzip = 0b00000100
- }
}
diff --git a/MediaBrowser.Common/Progress/ActionableProgress.cs b/MediaBrowser.Common/Progress/ActionableProgress.cs
index af69055aa..d5bcd5be9 100644
--- a/MediaBrowser.Common/Progress/ActionableProgress.cs
+++ b/MediaBrowser.Common/Progress/ActionableProgress.cs
@@ -5,15 +5,16 @@ using System;
namespace MediaBrowser.Common.Progress
{
/// <summary>
- /// Class ActionableProgress
+ /// Class ActionableProgress.
/// </summary>
- /// <typeparam name="T"></typeparam>
+ /// <typeparam name="T">The type for the action parameter.</typeparam>
public class ActionableProgress<T> : IProgress<T>
{
/// <summary>
- /// The _actions
+ /// The _actions.
/// </summary>
private Action<T> _action;
+
public event EventHandler<T> ProgressChanged;
/// <summary>
@@ -32,14 +33,4 @@ namespace MediaBrowser.Common.Progress
_action?.Invoke(value);
}
}
-
- public class SimpleProgress<T> : IProgress<T>
- {
- public event EventHandler<T> ProgressChanged;
-
- public void Report(T value)
- {
- ProgressChanged?.Invoke(this, value);
- }
- }
}
diff --git a/MediaBrowser.Common/Progress/SimpleProgress.cs b/MediaBrowser.Common/Progress/SimpleProgress.cs
new file mode 100644
index 000000000..d75675bf1
--- /dev/null
+++ b/MediaBrowser.Common/Progress/SimpleProgress.cs
@@ -0,0 +1,16 @@
+#pragma warning disable CS1591
+
+using System;
+
+namespace MediaBrowser.Common.Progress
+{
+ public class SimpleProgress<T> : IProgress<T>
+ {
+ public event EventHandler<T> ProgressChanged;
+
+ public void Report(T value)
+ {
+ ProgressChanged?.Invoke(this, value);
+ }
+ }
+}