Use file-scoped namespaces

This commit is contained in:
Archi
2021-11-10 21:23:24 +01:00
parent 95ad16e26d
commit 1e6ab11d9f
142 changed files with 25006 additions and 25006 deletions

View File

@@ -23,30 +23,30 @@ using System;
using System.Collections;
using System.Collections.Generic;
namespace ArchiSteamFarm.Collections {
internal sealed class ConcurrentEnumerator<T> : IEnumerator<T> {
public T Current => Enumerator.Current;
namespace ArchiSteamFarm.Collections;
private readonly IEnumerator<T> Enumerator;
private readonly IDisposable LockObject;
internal sealed class ConcurrentEnumerator<T> : IEnumerator<T> {
public T Current => Enumerator.Current;
object? IEnumerator.Current => Current;
private readonly IEnumerator<T> Enumerator;
private readonly IDisposable LockObject;
internal ConcurrentEnumerator(IReadOnlyCollection<T> collection, IDisposable lockObject) {
if (collection == null) {
throw new ArgumentNullException(nameof(collection));
}
object? IEnumerator.Current => Current;
LockObject = lockObject ?? throw new ArgumentNullException(nameof(lockObject));
Enumerator = collection.GetEnumerator();
internal ConcurrentEnumerator(IReadOnlyCollection<T> collection, IDisposable lockObject) {
if (collection == null) {
throw new ArgumentNullException(nameof(collection));
}
public void Dispose() {
Enumerator.Dispose();
LockObject.Dispose();
}
public bool MoveNext() => Enumerator.MoveNext();
public void Reset() => Enumerator.Reset();
LockObject = lockObject ?? throw new ArgumentNullException(nameof(lockObject));
Enumerator = collection.GetEnumerator();
}
public void Dispose() {
Enumerator.Dispose();
LockObject.Dispose();
}
public bool MoveNext() => Enumerator.MoveNext();
public void Reset() => Enumerator.Reset();
}