@@ -37,10 +37,7 @@ public CodeExplorerComponentViewModel(CodeExplorerItemViewModel parent, Declarat
37
37
: base ( declaration )
38
38
{
39
39
Parent = parent ;
40
-
41
- _icon = Icons . ContainsKey ( DeclarationType )
42
- ? Icons [ DeclarationType ]
43
- : GetImageSource ( CodeExplorerUI . status_offline ) ;
40
+ SetIcon ( ) ;
44
41
45
42
Items = declarations . GroupBy ( item => item . Scope ) . SelectMany ( grouping =>
46
43
grouping . Where ( item => item . ParentDeclaration != null
@@ -166,8 +163,13 @@ public bool IsTestModule
166
163
167
164
private readonly string _name ;
168
165
public override string Name => _name ;
169
-
170
- public override string NameWithSignature => _name ;
166
+
167
+ public override string NameWithSignature =>
168
+ $ "{ _name } { ( IsPredeclared ? " (Predeclared)" : string . Empty ) } ";
169
+
170
+ private bool IsPredeclared => Declaration != null &&
171
+ Declaration . Attributes . HasPredeclaredIdAttribute ( out _ ) &&
172
+ Declaration . IsUserDefined ;
171
173
172
174
public override QualifiedSelection ? QualifiedSelection => Declaration . QualifiedSelection ;
173
175
@@ -206,6 +208,9 @@ private DeclarationType DeclarationType
206
208
}
207
209
}
208
210
211
+ private static readonly BitmapImage PredeclaredIcon = GetImageSource ( CodeExplorerUI . ObjectClassPredeclared ) ;
212
+ private static readonly BitmapImage OopsIcon = GetImageSource ( CodeExplorerUI . status_offline ) ;
213
+
209
214
private static readonly IDictionary < DeclarationType , BitmapImage > Icons = new Dictionary < DeclarationType , BitmapImage >
210
215
{
211
216
{ DeclarationType . ClassModule , GetImageSource ( CodeExplorerUI . ObjectClass ) } ,
@@ -222,6 +227,22 @@ private DeclarationType DeclarationType
222
227
{ DeclarationType . RelatedDocument , GetImageSource ( CodeExplorerUI . document_import ) }
223
228
} ;
224
229
230
+ private void SetIcon ( )
231
+ {
232
+ if ( IsPredeclared )
233
+ {
234
+ _icon = PredeclaredIcon ;
235
+ return ;
236
+ }
237
+
238
+ if ( Icons . ContainsKey ( DeclarationType ) )
239
+ {
240
+ _icon = Icons [ DeclarationType ] ;
241
+ }
242
+
243
+ _icon = OopsIcon ;
244
+ }
245
+
225
246
private BitmapImage _icon ;
226
247
public override BitmapImage CollapsedIcon => _icon ;
227
248
public override BitmapImage ExpandedIcon => _icon ;
0 commit comments