Skip to content

Commit 2ee7b0a

Browse files
committed
Suppress implement IDisposable warnings (CA1001).
1 parent 5c4b51c commit 2ee7b0a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Rubberduck.Main/ComClientLibrary/UI/DockableWindowHost.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.ComponentModel;
33
using System.Diagnostics;
4+
using System.Diagnostics.CodeAnalysis;
45
using System.Drawing;
56
using System.Runtime.InteropServices;
67
using System.Windows.Forms;
@@ -81,6 +82,7 @@ public interface IDockableWindowHost
8182
//Nothing breaks because we declare a ProgId
8283
// ReSharper disable once InconsistentNaming
8384
//Underscores make classes invisible to VB6 object explorer
85+
[SuppressMessage("Microsoft.Design", "CA1001")] //This should *never* have Dispose called on it. See comment block above.
8486
public class _DockableWindowHost : COM_IOleObject, COM_IOleInPlaceObject, COM_IOleWindow, IDockableWindowHost
8587
{
8688
public static string RegisteredProgId => RubberduckProgId.DockableWindowHostProgId;

RubberduckTests/Mocks/MockVbeBuilder.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections;
22
using System.Collections.Generic;
3+
using System.Diagnostics.CodeAnalysis;
34
using System.Linq;
45
using Moq;
56
using Rubberduck.VBEditor;
@@ -12,12 +13,13 @@ namespace RubberduckTests.Mocks
1213
/// <summary>
1314
/// Builds a mock <see cref="IVBE"/>.
1415
/// </summary>
16+
[SuppressMessage("Microsoft.Design", "CA1001")] //CA1001 is complaining about RubberduckTests.Mocks.Windows, which doesn't need to be disposed in this context.
1517
public class MockVbeBuilder
1618
{
1719
public const string TestProjectName = "TestProject1";
1820
public const string TestModuleName = "TestModule1";
1921
private readonly Mock<IVBE> _vbe;
20-
private readonly Mock<IVBEEvents> _vbeEvents;
22+
private readonly Mock<IVBEEvents> _vbeEvents;
2123

2224
#region standard library paths (referenced in all VBA projects hosted in Microsoft Excel)
2325
public static readonly string LibraryPathVBA = @"C:\PROGRA~1\COMMON~1\MICROS~1\VBA\VBA7.1\VBE7.DLL"; // standard library, priority locked

0 commit comments

Comments
 (0)