Browse Source

Merge 1ab0ae246f into 0bfe222cf4

pull/3013/merge
workgroupengineering 4 days ago committed by GitHub
parent
commit
b414f5cbb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 49
      ILSpy/Images/AssemblyLoading.svg
  2. 28
      ILSpy/Images/AssemblyLoading.xaml
  3. 1
      ILSpy/Images/Images.cs
  4. 39
      ILSpy/TreeNodes/AssemblyReferenceTreeNode.cs

49
ILSpy/Images/AssemblyLoading.svg

@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
viewBox="0 0 16 16"
version="1.1"
id="svg3"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs3" />
<style
id="style1">.st0{opacity:0}.st0,.st1{fill:#f6f6f6}.st2{fill:#424242}</style>
<g
id="outline">
<path
class="st0"
d="M0 0h16v16H0z"
id="path1" />
<path
class="st1"
d="M16 3v9H8V9H6v2H0V4h6v2h2V3h8z"
id="path2" />
</g>
<g
id="icon_x5F_bg">
<path
class="st2"
d="M1 5h4v5H1zM9 4h6v7H9zM6 7h2v1H6z"
id="path3" />
</g>
<path
class="icon-canvas-transparent"
d="M 16,8.000001 V 16 H 8.000001 V 8.000001 Z"
id="canvas"
style="opacity:0;fill:#f6f6f6;stroke-width:0.5" />
<path
class="icon-vs-out"
d="m 16,12 c 0,2.2055 -1.7945,4 -4,4 C 9.7945007,16 8.000001,14.2055 8.000001,12 A 3.9949993,3.9949993 0 0 1 8.5440009,10.000001 H 8.000001 v -2 H 12 V 12 h -1.999999 c 0,1.103 0.896999,2 1.999999,2 1.103,0 2,-0.897 2,-2 0,-0.672 -0.3345,-1.294999 -0.895,-1.666999 l -0.4165,-0.277 1.1075,-1.6660001 0.4165,0.2765 A 3.9959993,3.9959993 0 0 1 16,12 Z"
id="outline-9"
style="fill:#f6f6f6;stroke-width:0.5" />
<g
id="iconBg"
transform="matrix(0.49999992,0,0,0.49999992,8.000001,8.000001)">
<path
class="icon-vs-action-blue"
d="m 15,8 c 0,3.859 -3.141,7 -7,7 C 4.14,15 1,11.859 1,8 A 7,7 0 0 1 3.12,3 H 1 V 1 H 7 V 7 H 5 V 4.002 A 5.01,5.01 0 0 0 3,8 c 0,2.757 2.243,5 5,5 2.757,0 5,-2.243 5,-5 A 4.993,4.993 0 0 0 10.764,3.833 L 11.871,2.167 A 6.989,6.989 0 0 1 15,8 Z"
id="path1-1"
style="fill:#00539c" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

28
ILSpy/Images/AssemblyLoading.xaml

@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
<?xml version="1.0" ?>
<DrawingGroup xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<DrawingGroup.ClipGeometry>
<RectangleGeometry Rect="0.0,0.0,16.0,16.0"/>
</DrawingGroup.ClipGeometry>
<GeometryDrawing Brush="#fff6f6f6">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M 16 3 v 9 H 8 V 9 H 6 v 2 H 0 V 4 h 6 v 2 h 2 V 3 h 8 z" FillRule="Nonzero"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#ff424242">
<GeometryDrawing.Geometry>
<PathGeometry Figures="M 1 5 h 4 v 5 H 1 z M 9 4 h 6 v 7 H 9 z M 6 7 h 2 v 1 H 6 z" FillRule="Nonzero"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="#fff6f6f6">
<GeometryDrawing.Geometry>
<PathGeometry Figures="m 16 12 c 0 2.2055 -1.7945 4 -4 4 C 9.7945 16 8 14.2055 8 12 A 3.995 3.995 0 0 1 8.544 10 H 8 v -2 H 12 V 12 h -2 c 0 1.103 0.896999 2 2 2 c 1.103 0 2 -0.897 2 -2 c 0 -0.672 -0.3345 -1.295 -0.895 -1.667 l -0.4165 -0.277 l 1.1075 -1.666 l 0.4165 0.2765 A 3.996 3.996 0 0 1 16 12 Z" FillRule="Nonzero"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<DrawingGroup Transform="0.49999992,0.0,0.0,0.49999992,8.000001,8.000001">
<GeometryDrawing Brush="#ff00539c">
<GeometryDrawing.Geometry>
<PathGeometry Figures="m 15 8 c 0 3.859 -3.141 7 -7 7 C 4.14 15 1 11.859 1 8 A 7 7 0 0 1 3.12 3 H 1 V 1 H 7 V 7 H 5 V 4.002 A 5.01 5.01 0 0 0 3 8 c 0 2.757 2.243 5 5 5 c 2.757 0 5 -2.243 5 -5 A 4.993 4.993 0 0 0 10.764 3.833 L 11.871 2.167 A 6.989 6.989 0 0 1 15 8 Z" FillRule="Nonzero"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingGroup>

1
ILSpy/Images/Images.cs

@ -51,6 +51,7 @@ namespace ICSharpCode.ILSpy @@ -51,6 +51,7 @@ namespace ICSharpCode.ILSpy
public static readonly ImageSource Assembly = Load("Assembly");
public static readonly ImageSource AssemblyWarning = Load("AssemblyWarning");
public static readonly ImageSource AssemblyLoading = Load(nameof(AssemblyLoading));
public static readonly ImageSource FindAssembly = Load("FindAssembly");
public static readonly ImageSource Library = Load("Library");

39
ILSpy/TreeNodes/AssemblyReferenceTreeNode.cs

@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
// Copyright (c) 2011 AlphaSierraPapa for the SharpDevelop Team
//
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
// to whom the Software is furnished to do so, subject to the following conditions:
//
//
// The above copyright notice and this permission notice shall be included in all copies or
// substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
@ -35,9 +35,18 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -35,9 +35,18 @@ namespace ICSharpCode.ILSpy.TreeNodes
/// </summary>
public sealed class AssemblyReferenceTreeNode : ILSpyTreeNode
{
private enum LoadState
{
Unloaded,
Loading,
Loadded,
Failed
}
readonly MetadataModule module;
readonly AssemblyReference r;
readonly AssemblyTreeNode parentAssembly;
MetadataFile referencedModule;
private LoadState state;
public AssemblyReferenceTreeNode(MetadataModule module, AssemblyReference r, AssemblyTreeNode parentAssembly)
{
@ -53,7 +62,27 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -53,7 +62,27 @@ namespace ICSharpCode.ILSpy.TreeNodes
get { return Language.EscapeName(r.Name) + GetSuffixString(r.Handle); }
}
public override object Icon => ImagesProvider.Assembly;
public override object Icon {
get {
if (state == LoadState.Unloaded)
{
state = LoadState.Loading;
Dispatcher.CurrentDispatcher.BeginInvoke(() => {
var resolver = parentAssembly.LoadedAssembly.GetAssemblyResolver();
referencedModule = resolver.Resolve(r);
state = referencedModule is null
? LoadState.Failed
: LoadState.Loadded;
RaisePropertyChanged(nameof(Icon));
}, DispatcherPriority.Background);
}
return state switch {
LoadState.Loadded => Images.Assembly,
LoadState.Failed => Images.AssemblyWarning,
_ => Images.AssemblyLoading,
};
}
}
public override bool ShowExpander {
get {
@ -65,7 +94,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -65,7 +94,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
// while the list of references is updated causes problems with WPF's ListView rendering.
// Moving the assembly resolving out of the "add assembly reference"-loop by using the
// dispatcher fixes the issue.
Dispatcher.CurrentDispatcher.BeginInvoke((Action)EnsureLazyChildren, DispatcherPriority.Normal);
Dispatcher.CurrentDispatcher.BeginInvoke(EnsureLazyChildren, DispatcherPriority.Normal);
}
return base.ShowExpander;
}

Loading…
Cancel
Save