Skip to content

Commit 23f438d

Browse files
committed
Added default icon for components of unexpected DeclarationType
1 parent ae54e94 commit 23f438d

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerComponentViewModel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ public CodeExplorerComponentViewModel(CodeExplorerItemViewModel parent, Declarat
4141
Parent = parent;
4242
Declaration = declaration;
4343
_projectsProvider = projectsProvider;
44-
_icon = Icons[DeclarationType];
44+
45+
_icon = Icons.ContainsKey(DeclarationType)
46+
? Icons[DeclarationType]
47+
: GetImageSource(resx.status_offline);
48+
4549
Items = declarations.GroupBy(item => item.Scope).SelectMany(grouping =>
4650
grouping.Where(item => item.ParentDeclaration != null
4751
&& item.ParentScope == declaration.Scope
448 Bytes
Loading

Rubberduck.Core/Rubberduck.Core.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -999,6 +999,7 @@
999999
<Content Include="Resources\document-block.png" />
10001000
<Content Include="Resources\document-globe.png" />
10011001
<Content Include="Resources\pencil-ruler.png" />
1002+
<Content Include="Resources\status-offline.png" />
10021003
<Content Include="Resources\ui-scroll-pane-form.png" />
10031004
<Content Include="Resources\ui-tab-content.png" />
10041005
<Resource Include="Resources\Rubberduck.png" />

Rubberduck.Core/UI/CodeExplorer/CodeExplorer.Designer.cs

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rubberduck.Core/UI/CodeExplorer/CodeExplorer.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,7 @@
277277
<data name="ui_tab_content" type="System.Resources.ResXFileRef, System.Windows.Forms">
278278
<value>..\..\Resources\ui-tab-content.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
279279
</data>
280+
<data name="status_offline" type="System.Resources.ResXFileRef, System.Windows.Forms">
281+
<value>..\..\Resources\status-offline.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
282+
</data>
280283
</root>

0 commit comments

Comments
 (0)