Skip to content

Commit 9fa002d

Browse files
committed
Seal classes with explicit interface implementations. Addresses CA1033
1 parent 1991a0c commit 9fa002d

34 files changed

+35
-35
lines changed

Rubberduck.Core/UI/CodeExplorer/CodeExplorerWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
namespace Rubberduck.UI.CodeExplorer
88
{
99
[ExcludeFromCodeCoverage]
10-
public partial class CodeExplorerWindow : UserControl, IDockableUserControl
10+
public sealed partial class CodeExplorerWindow : UserControl, IDockableUserControl
1111
{
1212
private const string ClassId = "C5318B59-172F-417C-88E3-B377CDA2D809";
1313
string IDockableUserControl.ClassId { get { return ClassId; } }

Rubberduck.Core/UI/CodeMetrics/CodeMetricsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Rubberduck.UI.CodeMetrics
77
{
88
[ExcludeFromCodeCoverage]
9-
public partial class CodeMetricsWindow : UserControl, IDockableUserControl
9+
public sealed partial class CodeMetricsWindow : UserControl, IDockableUserControl
1010
{
1111
private const string ClassId = "C5318B5A-172F-417C-88E3-B377CDA2D809";
1212
string IDockableUserControl.ClassId => ClassId;

Rubberduck.Core/UI/Inspections/InspectionResultsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace Rubberduck.UI.Inspections
55
{
6-
public partial class InspectionResultsWindow : UserControl, IDockableUserControl
6+
public sealed partial class InspectionResultsWindow : UserControl, IDockableUserControl
77
{
88
private const string ClassId = "D3B2A683-9856-4246-BDC8-6B0795DC875B";
99
string IDockableUserControl.ClassId { get { return ClassId; } }

Rubberduck.Core/UI/SimpleListControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Rubberduck.UI
88
{
9-
public partial class SimpleListControl : UserControl, IDockableUserControl
9+
public sealed partial class SimpleListControl : UserControl, IDockableUserControl
1010
{
1111
public SimpleListControl(Declaration target)
1212
: this(string.Format(RubberduckUI.AllReferences_Caption, target.IdentifierName))

Rubberduck.Core/UI/ToDoItems/ToDoExplorerWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
namespace Rubberduck.UI.ToDoItems
77
{
88
[ExcludeFromCodeCoverage]
9-
public partial class ToDoExplorerWindow : UserControl, IDockableUserControl
9+
public sealed partial class ToDoExplorerWindow : UserControl, IDockableUserControl
1010
{
1111
private const string ClassId = "8B071EDA-2C9C-4009-9A22-A1958BF98B28"; // todo get from Resources.Registration?
1212
string IDockableUserControl.ClassId { get { return ClassId; } }

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeInfos.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public void Document(StringLineBuilder output)
258258
///
259259
/// This class can also be cast to ComTypes.ITypeInfo for raw access to the underlying type information
260260
/// </remarks>
261-
public class TypeInfoWrapper : ComTypes.ITypeInfo, IDisposable
261+
public sealed class TypeInfoWrapper : ComTypes.ITypeInfo, IDisposable
262262
{
263263
private DisposableList<TypeInfoWrapper> _typeInfosWrapped;
264264
private TypeLibWrapper _containerTypeLib;

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeLibs.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace Rubberduck.VBEditor.ComManagement.TypeLibs
3434
/// VBEReferences collection, and CompileProject method.
3535
/// Can also be cast to ComTypes.ITypeLib for raw access to the underlying type library
3636
/// </remarks>
37-
public class TypeLibWrapper : ITypeLibWrapper
37+
public sealed class TypeLibWrapper : ITypeLibWrapper
3838
{
3939
private DisposableList<TypeInfoWrapper> _typeInfosWrapped;
4040
private readonly bool _wrappedObjectIsWeakReference;
@@ -413,7 +413,7 @@ void ComTypes.ITypeLib.ReleaseTLibAttr(IntPtr pTLibAttr)
413413
/// <summary>
414414
/// An enumerable class for iterating over the double linked list of ITypeLibs provided by the VBE
415415
/// </summary>
416-
public class VBETypeLibsIterator : IEnumerable<TypeLibWrapper>, IEnumerator<TypeLibWrapper>
416+
public sealed class VBETypeLibsIterator : IEnumerable<TypeLibWrapper>, IEnumerator<TypeLibWrapper>
417417
{
418418
private IntPtr _currentTypeLibPtr;
419419
private VBETypeLibObj _currentTypeLibStruct;

Rubberduck.VBEEditor/ComManagement/TypeLibs/TypeLibsSupport.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ public abstract class IIndexedCollectionBase<TItem> : IEnumerable<TItem>
702702
/// </summary>
703703
/// <typeparam name="TCollection">the IIndexedCollectionBase type</typeparam>
704704
/// <typeparam name="TItem">the collection element type</typeparam>
705-
public class IIndexedCollectionEnumerator<TCollection, TItem> : IEnumerator<TItem>
705+
public sealed class IIndexedCollectionEnumerator<TCollection, TItem> : IEnumerator<TItem>
706706
where TCollection : IIndexedCollectionBase<TItem>
707707
where TItem : class
708708
{

Rubberduck.VBEEditor/SafeComWrappers/ComWrapperEnumerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public interface IEnumVARIANT
7777
[PreserveSig] int Clone([Out] out IEnumVARIANT retval);
7878
}
7979

80-
public class ComWrapperEnumerator<TWrapperItem> : IEnumerator<TWrapperItem>
80+
public sealed class ComWrapperEnumerator<TWrapperItem> : IEnumerator<TWrapperItem>
8181
where TWrapperItem : class
8282
{
8383
private readonly Func<object, TWrapperItem> _itemWrapper;

Rubberduck.VBEditor.VB6/SafeComWrappers/Office/CommandBarButton.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// ReSharper disable once CheckNamespace - Special dispensation due to conflicting file vs namespace priorities
1010
namespace Rubberduck.VBEditor.SafeComWrappers.Office8
1111
{
12-
public class CommandBarButton : SafeRedirectedEventedComWrapper<MSO.CommandBarButton, VB.CommandBarEvents, VB._dispCommandBarControlEvents>, ICommandBarButton, VB._dispCommandBarControlEvents
12+
public sealed class CommandBarButton : SafeRedirectedEventedComWrapper<MSO.CommandBarButton, VB.CommandBarEvents, VB._dispCommandBarControlEvents>, ICommandBarButton, VB._dispCommandBarControlEvents
1313
{
1414
private readonly CommandBarControl _control;
1515
private readonly IVBE _vbe;

0 commit comments

Comments
 (0)