1
1
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
2
- //
2
+ //
3
3
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
4
4
// software and associated documentation files (the "Software"), to deal in the Software
5
5
// without restriction, including without limitation the rights to use, copy, modify, merge,
6
6
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
7
7
// to whom the Software is furnished to do so, subject to the following conditions:
8
- //
8
+ //
9
9
// The above copyright notice and this permission notice shall be included in all copies or
10
10
// substantial portions of the Software.
11
- //
11
+ //
12
12
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
13
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14
14
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
@@ -31,6 +31,7 @@ public sealed class AssemblyReferenceTreeNode : ILSpyTreeNode
31
31
{
32
32
readonly AssemblyReference r ;
33
33
readonly AssemblyTreeNode parentAssembly ;
34
+ private bool ? loadFualt ;
34
35
35
36
public AssemblyReferenceTreeNode ( AssemblyReference r , AssemblyTreeNode parentAssembly )
36
37
{
@@ -45,7 +46,10 @@ public override object Text {
45
46
get { return Language . EscapeName ( r . Name ) + GetSuffixString ( r . Handle ) ; }
46
47
}
47
48
48
- public override object Icon => Images . Assembly ;
49
+ public override object Icon => loadFualt switch {
50
+ true => Images . AssemblyWarning ,
51
+ _ => Images . Assembly
52
+ } ;
49
53
50
54
public override bool ShowExpander {
51
55
get {
@@ -79,9 +83,15 @@ protected override void LoadChildren()
79
83
var module = resolver . Resolve ( r ) ;
80
84
if ( module != null )
81
85
{
86
+ loadFualt = false ;
82
87
foreach ( var childRef in module . AssemblyReferences )
83
88
this . Children . Add ( new AssemblyReferenceTreeNode ( childRef , parentAssembly ) ) ;
84
89
}
90
+ else
91
+ {
92
+ loadFualt = true ;
93
+ }
94
+ RaisePropertyChanged ( nameof ( Icon ) ) ;
85
95
}
86
96
87
97
public override void Decompile ( Language language , ITextOutput output , DecompilationOptions options )
@@ -100,14 +110,22 @@ public override void Decompile(Language language, ITextOutput output, Decompilat
100
110
output . Indent ( ) ;
101
111
language . WriteCommentLine ( output , "Assembly reference loading information:" ) ;
102
112
if ( info . HasErrors )
113
+ {
103
114
language . WriteCommentLine ( output , "There were some problems during assembly reference load, see below for more information!" ) ;
115
+ loadFualt = true ;
116
+ }
117
+ else
118
+ {
119
+ loadFualt = false ;
120
+ }
104
121
foreach ( var item in info . Messages )
105
122
{
106
123
language . WriteCommentLine ( output , $ "{ item . Item1 } : { item . Item2 } ") ;
107
124
}
108
125
output . Unindent ( ) ;
109
126
output . WriteLine ( ) ;
110
127
}
128
+ RaisePropertyChanged ( nameof ( Icon ) ) ;
111
129
}
112
130
}
113
131
}
0 commit comments