@@ -154,50 +154,32 @@ public override object ToolTip {
154154 var metadata = module ? . Metadata ;
155155 if ( metadata ? . IsAssembly == true && metadata . TryGetFullAssemblyName ( out var assemblyName ) )
156156 {
157- #if CROSS_PLATFORM
158- tooltip . Inlines . Add ( new Bold ( ) . Add ( new Run ( "Name: " ) ) ) ;
159- #else
160- tooltip . Inlines . Add ( new Bold ( new Run ( "Name: " ) ) ) ;
161- #endif
157+ tooltip . Inlines . Add ( CreateBoldRun ( "Name: " ) ) ;
162158 tooltip . Inlines . Add ( new Run ( assemblyName ) ) ;
163159 tooltip . Inlines . Add ( new LineBreak ( ) ) ;
164160 }
165- #if CROSS_PLATFORM
166- tooltip . Inlines . Add ( new Bold ( ) . Add ( new Run ( "Location: " ) ) ) ;
167- #else
168- tooltip . Inlines . Add ( new Bold ( new Run ( "Location: " ) ) ) ;
169- #endif
161+
162+ tooltip . Inlines . Add ( CreateBoldRun ( "Location: " ) ) ;
170163 tooltip . Inlines . Add ( new Run ( LoadedAssembly . FileName ) ) ;
164+
171165 if ( module != null )
172166 {
173167 if ( module is PEFile peFile )
174168 {
175169 tooltip . Inlines . Add ( new LineBreak ( ) ) ;
176- #if CROSS_PLATFORM
177- tooltip . Inlines . Add ( new Bold ( ) . Add ( new Run ( "Architecture: " ) ) ) ;
178- #else
179- tooltip . Inlines . Add ( new Bold ( new Run ( "Architecture: " ) ) ) ;
180- #endif
170+ tooltip . Inlines . Add ( CreateBoldRun ( "Architecture: " ) ) ;
181171 tooltip . Inlines . Add ( new Run ( Language . GetPlatformDisplayName ( peFile ) ) ) ;
182172 }
183173 string runtimeName = Language . GetRuntimeDisplayName ( module ) ;
184174 if ( runtimeName != null )
185175 {
186176 tooltip . Inlines . Add ( new LineBreak ( ) ) ;
187- #if CROSS_PLATFORM
188- tooltip . Inlines . Add ( new Bold ( ) . Add ( new Run ( "Runtime: " ) ) ) ;
189- #else
190- tooltip . Inlines . Add ( new Bold ( new Run ( "Runtime: " ) ) ) ;
191- #endif
177+ tooltip . Inlines . Add ( CreateBoldRun ( "Runtime: " ) ) ;
192178 tooltip . Inlines . Add ( new Run ( runtimeName ) ) ;
193179 }
194180 var debugInfo = LoadedAssembly . GetDebugInfoOrNull ( ) ;
195181 tooltip . Inlines . Add ( new LineBreak ( ) ) ;
196- #if CROSS_PLATFORM
197- tooltip . Inlines . Add ( new Bold ( ) . Add ( new Run ( "Debug info: " ) ) ) ;
198- #else
199- tooltip . Inlines . Add ( new Bold ( new Run ( "Debug info: " ) ) ) ;
200- #endif
182+ tooltip . Inlines . Add ( CreateBoldRun ( "Debug info: " ) ) ;
201183 tooltip . Inlines . Add ( new Run ( debugInfo ? . Description ?? "none" ) ) ;
202184 }
203185 }
@@ -206,6 +188,15 @@ public override object ToolTip {
206188 }
207189 }
208190
191+ private static Bold CreateBoldRun ( string text )
192+ {
193+ #if CROSS_PLATFORM
194+ return new Bold ( ) . Add ( new Run ( text ) ) ) ;
195+ #else
196+ return new Bold ( new Run ( text ) ) ;
197+ #endif
198+ }
199+
209200 public void UpdateToolTip ( )
210201 {
211202 tooltip = null ;
0 commit comments