File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
Rubberduck.Core/Navigation/CodeExplorer Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,11 @@ public sealed class CodeExplorerSubMemberViewModel : CodeExplorerItemViewModel
11
11
DeclarationType . UserDefinedTypeMember
12
12
} ;
13
13
14
- private readonly string _signature = string . Empty ;
14
+ private string _signature = string . Empty ;
15
15
16
16
public CodeExplorerSubMemberViewModel ( ICodeExplorerNode parent , Declaration declaration ) : base ( parent , declaration )
17
17
{
18
- if ( Declaration is ValuedDeclaration value && ! string . IsNullOrEmpty ( value . Expression ) )
19
- {
20
- _signature = $ " = { value . Expression } ";
21
- }
18
+ UpdateSignature ( ) ;
22
19
}
23
20
24
21
public override string Name => Declaration ? . IdentifierName ?? string . Empty ;
@@ -30,6 +27,7 @@ public override void Synchronize(ref List<Declaration> updated)
30
27
var signature = _signature ;
31
28
32
29
base . Synchronize ( ref updated ) ;
30
+ UpdateSignature ( ) ;
33
31
if ( Declaration is null || _signature . Equals ( signature ) )
34
32
{
35
33
return ;
@@ -39,6 +37,18 @@ public override void Synchronize(ref List<Declaration> updated)
39
37
OnNameChanged ( ) ;
40
38
}
41
39
40
+ private void UpdateSignature ( )
41
+ {
42
+ if ( Declaration is ValuedDeclaration value && ! string . IsNullOrEmpty ( value . Expression ) )
43
+ {
44
+ _signature = $ " = { value . Expression } ";
45
+ }
46
+ else
47
+ {
48
+ _signature = "" ;
49
+ }
50
+ }
51
+
42
52
public override Comparer < ICodeExplorerNode > SortComparer =>
43
53
SortOrder . HasFlag ( CodeExplorerSortOrder . Name )
44
54
? CodeExplorerItemComparer . Name
You can’t perform that action at this time.
0 commit comments