forked from dnnsoftware/Dnn.Platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves 1793 build warnings in Library project (dnnsoftware#4204)
* Resolves 1793 build warnings in DotNetNuke.Collections This PR covers pretty much all the Collections folder. I am no expert in this area, so any feedback on the documentation is welcome * Update DNN Platform/Library/Collections/LockingStrategy.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/MonitorLock.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/MonitorLock.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/NaiveLockingList.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/NaiveLockingList.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/SharedList.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Common/Lists/CachedCountryList.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Common/Lists/ListInfo.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Common/NavigationManager.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Common/ServiceScopeContainer.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/ReaderWriterSlimLock.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Update DNN Platform/Library/Collections/SharedDictionary.cs Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> * Implemented CLSCompliant attribute on DotNetNuke.Abstractions and DotNetNuke.DependencyInjection * Marked IDNNStartup as not CSL Compliant * Update DNN Platform/Library/Services/Journal/JournalControllerImpl.cs Co-authored-by: David Poindexter <dpoindexter@nvisionative.com> * Update DNN Platform/Library/Services/Scheduling/DNNScheduler.cs Co-authored-by: David Poindexter <dpoindexter@nvisionative.com> * Update DNN Platform/Library/Services/Search/Internals/LuceneControllerImpl.cs Co-authored-by: David Poindexter <dpoindexter@nvisionative.com> Co-authored-by: Brian Dukes <bdukes@engagesoftware.com> Co-authored-by: David Poindexter <dpoindexter@nvisionative.com>
- Loading branch information
1 parent
621ba3a
commit a37c4f8
Showing
591 changed files
with
11,211 additions
and
6,828 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
DNN Platform/DotNetNuke.Abstractions/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
|
||
using System; | ||
|
||
[assembly: CLSCompliant(true)] |
42 changes: 23 additions & 19 deletions
42
DNN Platform/DotNetNuke.DependencyInjection/IDnnStartup.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
namespace DotNetNuke.DependencyInjection | ||
{ | ||
using Microsoft.Extensions.DependencyInjection; | ||
namespace DotNetNuke.DependencyInjection | ||
{ | ||
using System; | ||
|
||
/// <summary> | ||
/// An interface for adding extension points to the DNN Startup Logic. | ||
/// </summary> | ||
public interface IDnnStartup | ||
{ | ||
/// <summary> | ||
/// Configure additional services for the host or web application. | ||
/// This method will be called during the Application Startup phase | ||
/// and services will be available anywhere in the application. | ||
/// </summary> | ||
/// <param name="services"> | ||
/// Service Collection used to registering services in the container. | ||
/// </param> | ||
void ConfigureServices(IServiceCollection services); | ||
} | ||
} | ||
using Microsoft.Extensions.DependencyInjection; | ||
|
||
/// <summary> | ||
/// An interface for adding extension points to the DNN Startup Logic. | ||
/// </summary> | ||
[CLSCompliant(false)] | ||
public interface IDnnStartup | ||
{ | ||
/// <summary> | ||
/// Configure additional services for the host or web application. | ||
/// This method will be called during the Application Startup phase | ||
/// and services will be available anywhere in the application. | ||
/// </summary> | ||
/// <param name="services"> | ||
/// Service Collection used to registering services in the container. | ||
/// </param> | ||
[CLSCompliant(false)] | ||
void ConfigureServices(IServiceCollection services); | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
DNN Platform/DotNetNuke.DependencyInjection/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
|
||
using System; | ||
|
||
[assembly: CLSCompliant(true)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
namespace DotNetNuke.Collections.Internal | ||
{ | ||
namespace DotNetNuke.Collections.Internal | ||
{ | ||
using System; | ||
|
||
public interface ISharedCollectionLock : IDisposable | ||
/// <summary> | ||
/// Represents a shared collection lock. | ||
/// </summary> | ||
public interface ISharedCollectionLock : IDisposable | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 29 additions & 21 deletions
50
DNN Platform/Library/Collections/LockingStrategyFactory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
namespace DotNetNuke.Collections.Internal | ||
{ | ||
namespace DotNetNuke.Collections.Internal | ||
{ | ||
using System; | ||
|
||
internal class LockingStrategyFactory | ||
{ | ||
public static ILockStrategy Create(LockingStrategy strategy) | ||
{ | ||
switch (strategy) | ||
{ | ||
case LockingStrategy.ReaderWriter: | ||
|
||
return new ReaderWriterLockStrategy(); | ||
case LockingStrategy.Exclusive: | ||
|
||
return new ExclusiveLockStrategy(); | ||
default: | ||
|
||
throw new ArgumentOutOfRangeException(); | ||
} | ||
} | ||
} | ||
} | ||
/// <summary> | ||
/// Factory class for LockingStrategies. | ||
/// </summary> | ||
internal class LockingStrategyFactory | ||
{ | ||
/// <summary> | ||
/// Creates a new locking strategy. | ||
/// </summary> | ||
/// <param name="strategy">The <see cref="LockingStrategy"/> to instantiate.</param> | ||
/// <returns>An instance of <see cref="ILockStrategy"/> that uses the specified strategy.</returns> | ||
public static ILockStrategy Create(LockingStrategy strategy) | ||
{ | ||
switch (strategy) | ||
{ | ||
case LockingStrategy.ReaderWriter: | ||
|
||
return new ReaderWriterLockStrategy(); | ||
case LockingStrategy.Exclusive: | ||
|
||
return new ExclusiveLockStrategy(); | ||
default: | ||
|
||
throw new ArgumentOutOfRangeException(); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,53 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
namespace DotNetNuke.Collections.Internal | ||
{ | ||
namespace DotNetNuke.Collections.Internal | ||
{ | ||
using System; | ||
|
||
internal class MonitorLock : IDisposable, ISharedCollectionLock | ||
{ | ||
private ExclusiveLockStrategy _lockStrategy; | ||
|
||
// To detect redundant calls | ||
private bool _isDisposed; | ||
|
||
public MonitorLock(ExclusiveLockStrategy lockStrategy) | ||
{ | ||
this._lockStrategy = lockStrategy; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
// Do not change this code. Put cleanup code in Dispose(ByVal disposing As Boolean) above. | ||
this.Dispose(true); | ||
GC.SuppressFinalize(this); | ||
} | ||
|
||
protected virtual void Dispose(bool disposing) | ||
{ | ||
if (!this._isDisposed) | ||
{ | ||
if (disposing) | ||
{ | ||
this._lockStrategy.Exit(); | ||
this._lockStrategy = null; | ||
} | ||
} | ||
|
||
this._isDisposed = true; | ||
} | ||
} | ||
} | ||
/// <summary> | ||
/// An <see cref="ISharedCollectionLock"/> implementation which uses an <see cref="ExclusiveLockStrategy"/>. | ||
/// </summary> | ||
internal class MonitorLock : IDisposable, ISharedCollectionLock | ||
{ | ||
private ExclusiveLockStrategy lockStrategy; | ||
|
||
// To detect redundant calls | ||
private bool isDisposed; | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="MonitorLock"/> class. | ||
/// </summary> | ||
/// <param name="lockStrategy">An <see cref="ExclusiveLockStrategy"/> instance to use.</param> | ||
public MonitorLock(ExclusiveLockStrategy lockStrategy) | ||
{ | ||
this.lockStrategy = lockStrategy; | ||
} | ||
|
||
/// <inheritdoc/> | ||
public void Dispose() | ||
{ | ||
// Do not change this code. Put cleanup code in Dispose(bool disposing) below. | ||
this.Dispose(true); | ||
GC.SuppressFinalize(this); | ||
} | ||
|
||
/// <summary> | ||
/// Releases resources before final disposal. | ||
/// </summary> | ||
/// <param name="disposing">A value indicating if the instance is currently beeing disposed.</param> | ||
protected virtual void Dispose(bool disposing) | ||
{ | ||
if (!this.isDisposed) | ||
{ | ||
if (disposing) | ||
{ | ||
this.lockStrategy.Exit(); | ||
this.lockStrategy = null; | ||
} | ||
} | ||
|
||
this.isDisposed = true; | ||
} | ||
} | ||
} |
Oops, something went wrong.