diff --git a/src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Scope.cs b/src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Scope.cs index ae8a233c..7797acd1 100644 --- a/src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Scope.cs +++ b/src/NetEvolve.CodeBuilder/CSharpCodeBuilder.Scope.cs @@ -50,18 +50,18 @@ public IDisposable ScopeLine(string? value) } /// - /// A disposable struct that manages indentation scope for a . + /// A disposable class that manages indentation scope for a . /// /// - /// This struct increments the indentation level when created and decrements it when disposed. + /// This class increments the indentation level when created and decrements it when disposed. /// It is designed to work with the 'using' statement to provide automatic indentation management. /// - private readonly struct ScopeHandler : IDisposable, IEquatable + private sealed class ScopeHandler : IDisposable { private readonly CSharpCodeBuilder _builder; /// - /// Initializes a new instance of the struct and increments the indentation level. + /// Initializes a new instance of the class and increments the indentation level. /// /// The instance to manage indentation for. internal ScopeHandler(CSharpCodeBuilder builder) @@ -77,41 +77,5 @@ internal ScopeHandler(CSharpCodeBuilder builder) /// This method is called automatically when the 'using' statement block ends. /// public void Dispose() => _ = _builder.Append('}'); - - /// - /// Determines whether the specified object is equal to the current instance. - /// - /// The object to compare with the current instance. - /// Always returns since ScopeHandler instances should not be compared. - public override readonly bool Equals(object? obj) => false; - - /// - /// Determines whether the specified ScopeHandler is equal to the current instance. - /// - /// The ScopeHandler to compare with the current instance. - /// Always returns since ScopeHandler instances should not be compared. - public readonly bool Equals(ScopeHandler other) => false; - - /// - /// Returns the hash code for this instance. - /// - /// A hash code based on the internal builder reference. - public override readonly int GetHashCode() => _builder?.GetHashCode() ?? 0; - - /// - /// Determines whether two ScopeHandler instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// Always returns since ScopeHandler instances should not be compared. - public static bool operator ==(ScopeHandler _, ScopeHandler __) => false; - - /// - /// Determines whether two ScopeHandler instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// Always returns since ScopeHandler instances should not be compared. - public static bool operator !=(ScopeHandler _, ScopeHandler __) => true; } }