Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bclothier committed Nov 13, 2018
1 parent 71034ff commit 869f783
Show file tree
Hide file tree
Showing 8 changed files with 156 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ public void RemoveCommandBar()
Logger.Debug("Removing commandbar.");
RemoveChildren();
Item.Delete();

// Setting them to null will automatically dispose those
Item = null;
Parent = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public void RemoveMenu()
Logger.Debug($"Removing menu {_key}.");
RemoveChildren();
Item?.Delete();

//This will also dispose the Item as well
Item = null;
}

Expand Down
144 changes: 144 additions & 0 deletions Rubberduck.Resources/Rubberduck.Resources.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,170 @@
</ItemGroup>

<ItemGroup>
<Compile Update="About\AboutUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AboutUI.resx</DependentUpon>
</Compile>
<Compile Update="CodeExplorer\CodeExplorerUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CodeExplorerUI.resx</DependentUpon>
</Compile>
<Compile Update="CommandBarIcons.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>CommandBarIcons.resx</DependentUpon>
</Compile>
<Compile Update="Inspections\InspectionInfo.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>InspectionInfo.resx</DependentUpon>
</Compile>
<Compile Update="Inspections\InspectionNames.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>InspectionNames.resx</DependentUpon>
</Compile>
<Compile Update="Inspections\InspectionResults.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>InspectionResults.resx</DependentUpon>
</Compile>
<Compile Update="Inspections\InspectionsUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>InspectionsUI.resx</DependentUpon>
</Compile>
<Compile Update="Inspections\QuickFixes.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>QuickFixes.resx</DependentUpon>
</Compile>
<Compile Update="Menus\RubberduckMenus.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>RubberduckMenus.resx</DependentUpon>
</Compile>
<Compile Update="RegexAssistant\RegexAssistantUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>RegexAssistantUI.resx</DependentUpon>
</Compile>
<Compile Update="RubberduckUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>RubberduckUI.resx</DependentUpon>
</Compile>
<Compile Update="Settings\AutoCompletesPage.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AutoCompletesPage.resx</DependentUpon>
</Compile>
<Compile Update="Settings\SettingsUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>SettingsUI.resx</DependentUpon>
</Compile>
<Compile Update="Settings\ToDoExplorerPage.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ToDoExplorerPage.resx</DependentUpon>
</Compile>
<Compile Update="Settings\UnitTestingPage.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>UnitTestingPage.resx</DependentUpon>
</Compile>
<Compile Update="ToDoExplorer\ToDoExplorerUI.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>ToDoExplorerUI.resx</DependentUpon>
</Compile>
<Compile Update="UnitTesting\AssertMessages.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AssertMessages.resx</DependentUpon>
</Compile>
<Compile Update="UnitTesting\TestExplorer.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>TestExplorer.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<EmbeddedResource Update="About\AboutUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>AboutUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="CodeExplorer\CodeExplorerUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>CodeExplorerUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="CommandBarIcons.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>CommandBarIcons.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Inspections\InspectionInfo.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>InspectionInfo.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Inspections\InspectionNames.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>InspectionNames.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Inspections\InspectionResults.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>InspectionResults.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Inspections\InspectionsUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>InspectionsUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Inspections\QuickFixes.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>QuickFixes.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Menus\RubberduckMenus.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>RubberduckMenus.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="RegexAssistant\RegexAssistantUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>RegexAssistantUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="RubberduckUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>RubberduckUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Settings\AutoCompletesPage.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>AutoCompletesPage.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Settings\SettingsUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>SettingsUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Settings\ToDoExplorerPage.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>ToDoExplorerPage.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="Settings\UnitTestingPage.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>UnitTestingPage.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="ToDoExplorer\ToDoExplorerUI.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>ToDoExplorerUI.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="UnitTesting\AssertMessages.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>AssertMessages.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Update="UnitTesting\TestExplorer.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>TestExplorer.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion Rubberduck.VBEEditor/Events/VbeEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ private void RegisterComponents(string projectId, string projectName)
if (item.ProjectId == projectId && item.Name == projectName)
{
project = item;
item.Dispose();
break;
}

Expand Down
2 changes: 1 addition & 1 deletion Rubberduck.VBEditor.VB6/SafeComWrappers/VB/CodePane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void ForceFocus()
}
else
{
System.Diagnostics.Debug.WriteLine(
_logger.Debug(
"CodePane.ForceFocus() failed to get a handle on the MainWindow.");
}
}
Expand Down
6 changes: 3 additions & 3 deletions Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBProjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ void VB._dispVBProjectsEvents.ItemRenamed([MarshalAs(UnmanagedType.Interface), I

var projectId = project.ProjectId;

var handler = ProjectRenamed;
if (handler == null || projectId == null)
if (projectId == null)
{
return;
}

handler.Invoke(this, new ProjectRenamedEventArgs(projectId, project.Name, OldName));
var handler = ProjectRenamed;
handler?.Invoke(this, new ProjectRenamedEventArgs(projectId, project.Name, OldName));
}
}

Expand Down
2 changes: 1 addition & 1 deletion Rubberduck.VBEditor.VBA/SafeComWrappers/VB/CodePane.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private void ForceFocus()
}
else
{
System.Diagnostics.Debug.WriteLine(
_logger.Debug(
"CodePane.ForceFocus() failed to get a handle on the MainWindow.");
}
}
Expand Down
6 changes: 3 additions & 3 deletions Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBProjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ void VB._dispVBProjectsEvents.ItemRenamed([MarshalAs(UnmanagedType.Interface), I

var projectId = project.ProjectId;

var handler = ProjectRenamed;
if (handler == null || projectId == null)
if (projectId == null)
{
return;
}

handler.Invoke(this, new ProjectRenamedEventArgs(projectId, project.Name, OldName));
var handler = ProjectRenamed;
handler?.Invoke(this, new ProjectRenamedEventArgs(projectId, project.Name, OldName));
}
}

Expand Down

0 comments on commit 869f783

Please sign in to comment.