Browse Source

SharpTreeView: Split into ILSpyX.TreeView and ILSpy.Controls.TreeView (#3240)

* Changes necessary for making SharpTreeNode cross platform by proxying System.Windows dependencies
* Add ITreeNodeImagesProvider for node icons
* Move InternalsVisibleTo to csproj (possible since net50)
* Move view models and other xplat class for SharpTreeView to ILSpyX, Windows-dependent classes to ILSpy/Controls/TreeView
* Move GetDoubleClickTime to NativeMethods
pull/3245/head
Christoph Wille 11 months ago committed by GitHub
parent
commit
d54ac416f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj
  2. 4
      ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs
  3. 4
      ICSharpCode.ILSpyX/TreeView/FlatListTreeNode.cs
  4. 10
      ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDataObject.cs
  5. 7
      ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragDrop.cs
  6. 8
      ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragEventArgs.cs
  7. 7
      ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformRoutedEventArgs.cs
  8. 7
      ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/ITreeNodeImagesProvider.cs
  9. 36
      ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/XPlatDragDropEffects.cs
  10. 35
      ICSharpCode.ILSpyX/TreeView/SharpTreeNode.cs
  11. 4
      ICSharpCode.ILSpyX/TreeView/SharpTreeNodeCollection.cs
  12. 4
      ICSharpCode.ILSpyX/TreeView/TreeFlattener.cs
  13. 2
      ICSharpCode.ILSpyX/TreeView/TreeTraversal.cs
  14. 1
      ILSpy.Wpf.slnf
  15. 8
      ILSpy.sln
  16. 5
      ILSpy/Analyzers/AnalyzerEntityTreeNode.cs
  17. 4
      ILSpy/Analyzers/AnalyzerTreeNode.cs
  18. 3
      ILSpy/Analyzers/AnalyzerTreeView.cs
  19. 3
      ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs
  20. 3
      ILSpy/App.xaml.cs
  21. 2
      ILSpy/Commands/SaveCodeContextMenuEntry.cs
  22. 2
      ILSpy/Commands/SortAssemblyListCommand.cs
  23. 3
      ILSpy/ContextMenuEntry.cs
  24. 2
      ILSpy/Controls/TreeView/Converters.cs
  25. 4
      ILSpy/Controls/TreeView/EditTextBox.cs
  26. 2
      ILSpy/Controls/TreeView/ExtensionMethods.cs
  27. 2
      ILSpy/Controls/TreeView/GeneralAdorner.cs
  28. 2
      ILSpy/Controls/TreeView/InsertMarker.cs
  29. 2
      ILSpy/Controls/TreeView/LinesRenderer.cs
  30. 2
      ILSpy/Controls/TreeView/SharpGridView.cs
  31. 5
      ILSpy/Controls/TreeView/SharpTreeNodeView.cs
  32. 16
      ILSpy/Controls/TreeView/SharpTreeView.cs
  33. 2
      ILSpy/Controls/TreeView/SharpTreeView.xaml
  34. 2
      ILSpy/Controls/TreeView/SharpTreeViewAutomationPeer.cs
  35. 10
      ILSpy/Controls/TreeView/SharpTreeViewItem.cs
  36. 4
      ILSpy/Controls/TreeView/SharpTreeViewItemAutomationPeer.cs
  37. 9
      ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs
  38. 31
      ILSpy/Controls/TreeView/WpfWindowsDataObject.cs
  39. 14
      ILSpy/Controls/TreeView/WpfWindowsDragDropManager.cs
  40. 20
      ILSpy/Controls/TreeView/WpfWindowsDragEventArgs.cs
  41. 18
      ILSpy/Controls/TreeView/WpfWindowsRoutedEventArgs.cs
  42. 1
      ILSpy/ILSpy.csproj
  43. 9
      ILSpy/Images/WpfWindowsTreeNodeImagesProvider.cs
  44. 4
      ILSpy/MainWindow.xaml
  45. 3
      ILSpy/MainWindow.xaml.cs
  46. 3
      ILSpy/NativeMethods.cs
  47. 2
      ILSpy/NavigationState.cs
  48. 1
      ILSpy/Themes/generic.xaml
  49. 13
      ILSpy/TreeNodes/AssemblyListTreeNode.cs
  50. 7
      ILSpy/TreeNodes/AssemblyReferenceTreeNode.cs
  51. 12
      ILSpy/TreeNodes/AssemblyTreeNode.cs
  52. 5
      ILSpy/TreeNodes/BaseTypesEntryNode.cs
  53. 2
      ILSpy/TreeNodes/BaseTypesTreeNode.cs
  54. 3
      ILSpy/TreeNodes/DerivedTypesEntryNode.cs
  55. 9
      ILSpy/TreeNodes/ILSpyTreeNode.cs
  56. 3
      ILSpy/TreeNodes/ModuleReferenceTreeNode.cs
  57. 2
      ILSpy/TreeNodes/PackageFolderTreeNode.cs
  58. 2
      ILSpy/TreeNodes/ThreadingSupport.cs
  59. 28
      SharpTreeView/ICSharpCode.TreeView.csproj
  60. 54
      SharpTreeView/Properties/AssemblyInfo.cs
  61. 51
      SharpTreeView/Properties/GlobalAssemblyInfo.cs

5
ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj

@ -40,6 +40,11 @@
<PublishRepositoryUrl>true</PublishRepositoryUrl> <PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<InternalsVisibleTo Include="ILSpy" Key="00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf" />
<InternalsVisibleTo Include="ILSpy.Tests" Key="00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="PackageReadme.md" Pack="true" PackagePath="\" /> <None Include="PackageReadme.md" Pack="true" PackagePath="\" />
</ItemGroup> </ItemGroup>

4
ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs

@ -19,7 +19,3 @@ using System.Runtime.Versioning;
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly", [assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
Justification = "AssemblyInformationalVersion does not need to be a parsable version")] Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
[assembly: InternalsVisibleTo("ILSpy, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")]
[assembly: InternalsVisibleTo("ILSpy.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")]

4
SharpTreeView/FlatListTreeNode.cs → ICSharpCode.ILSpyX/TreeView/FlatListTreeNode.cs

@ -20,7 +20,9 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
namespace ICSharpCode.TreeView #nullable disable
namespace ICSharpCode.ILSpyX.TreeView
{ {
// This part of SharpTreeNode controls the 'flat list' data structure, which emulates // This part of SharpTreeNode controls the 'flat list' data structure, which emulates
// a big flat list containing the whole tree; allowing access by visible index. // a big flat list containing the whole tree; allowing access by visible index.

10
ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDataObject.cs

@ -0,0 +1,10 @@
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
{
public interface IPlatformDataObject
{
bool GetDataPresent(string format);
object GetData(string format);
void SetData(string format, object data);
}
}

7
ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragDrop.cs

@ -0,0 +1,7 @@
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
{
public interface IPlatformDragDrop
{
XPlatDragDropEffects DoDragDrop(object dragSource, object data, XPlatDragDropEffects allowedEffects);
}
}

8
ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragEventArgs.cs

@ -0,0 +1,8 @@
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
{
public interface IPlatformDragEventArgs
{
XPlatDragDropEffects Effects { get; set; }
IPlatformDataObject Data { get; }
}
}

7
ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformRoutedEventArgs.cs

@ -0,0 +1,7 @@
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
{
public interface IPlatformRoutedEventArgs
{
bool Handled { get; set; }
}
}

7
ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/ITreeNodeImagesProvider.cs

@ -0,0 +1,7 @@
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
{
public interface ITreeNodeImagesProvider
{
object Assembly { get; }
}
}

36
ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/XPlatDragDropEffects.cs

@ -0,0 +1,36 @@
using System;
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
{
//
// Summary:
// Specifies the effects of a drag-and-drop operation.
[Flags]
public enum XPlatDragDropEffects
{
//
// Summary:
// Scrolling is about to start or is currently occurring in the drop target.
Scroll = int.MinValue,
//
// Summary:
// The data is copied, removed from the drag source, and scrolled in the drop target.
All = -2147483645,
//
// Summary:
// The drop target does not accept the data.
None = 0,
//
// Summary:
// The data is copied to the drop target.
Copy = 1,
//
// Summary:
// The data from the drag source is moved to the drop target.
Move = 2,
//
// Summary:
// The data from the drag source is linked to the drop target.
Link = 4
}
}

35
SharpTreeView/SharpTreeNode.cs → ICSharpCode.ILSpyX/TreeView/SharpTreeNode.cs

@ -22,14 +22,18 @@ using System.Collections.Specialized;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
namespace ICSharpCode.TreeView #nullable disable
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpyX.TreeView
{ {
public partial class SharpTreeNode : INotifyPropertyChanged public partial class SharpTreeNode : INotifyPropertyChanged
{ {
protected static ITreeNodeImagesProvider ImagesProvider { get; private set; }
public static void SetImagesProvider(ITreeNodeImagesProvider provider) => ImagesProvider = provider;
SharpTreeNodeCollection modelChildren; SharpTreeNodeCollection modelChildren;
internal SharpTreeNode modelParent; internal SharpTreeNode modelParent;
bool isVisible = true; bool isVisible = true;
@ -584,7 +588,7 @@ namespace ICSharpCode.TreeView
throw new NotSupportedException(GetType().Name + " does not support deletion"); throw new NotSupportedException(GetType().Name + " does not support deletion");
} }
public virtual IDataObject Copy(SharpTreeNode[] nodes) public virtual IPlatformDataObject Copy(SharpTreeNode[] nodes)
{ {
throw new NotSupportedException(GetType().Name + " does not support copy/paste or drag'n'drop"); throw new NotSupportedException(GetType().Name + " does not support copy/paste or drag'n'drop");
} }
@ -614,25 +618,26 @@ namespace ICSharpCode.TreeView
return false; return false;
} }
public virtual void StartDrag(DependencyObject dragSource, SharpTreeNode[] nodes) public virtual void StartDrag(object dragSource, SharpTreeNode[] nodes, IPlatformDragDrop dragdropManager)
{ {
DragDropEffects effects = DragDropEffects.All; XPlatDragDropEffects effects = XPlatDragDropEffects.All;
if (!nodes.All(n => n.CanDelete())) if (!nodes.All(n => n.CanDelete()))
effects &= ~DragDropEffects.Move; effects &= ~XPlatDragDropEffects.Move;
DragDropEffects result = DragDrop.DoDragDrop(dragSource, Copy(nodes), effects);
if (result == DragDropEffects.Move) XPlatDragDropEffects result = dragdropManager.DoDragDrop(dragSource, Copy(nodes), effects);
if (result == XPlatDragDropEffects.Move)
{ {
foreach (SharpTreeNode node in nodes) foreach (SharpTreeNode node in nodes)
node.DeleteCore(); node.DeleteCore();
} }
} }
public virtual bool CanDrop(DragEventArgs e, int index) public virtual bool CanDrop(IPlatformDragEventArgs e, int index)
{ {
return false; return false;
} }
internal void InternalDrop(DragEventArgs e, int index) internal void InternalDrop(IPlatformDragEventArgs e, int index)
{ {
if (LazyLoading) if (LazyLoading)
{ {
@ -643,7 +648,7 @@ namespace ICSharpCode.TreeView
Drop(e, index); Drop(e, index);
} }
public virtual void Drop(DragEventArgs e, int index) public virtual void Drop(IPlatformDragEventArgs e, int index)
{ {
throw new NotSupportedException(GetType().Name + " does not support Drop()"); throw new NotSupportedException(GetType().Name + " does not support Drop()");
} }
@ -703,14 +708,14 @@ namespace ICSharpCode.TreeView
/// <summary> /// <summary>
/// Gets called when the item is double-clicked. /// Gets called when the item is double-clicked.
/// </summary> /// </summary>
public virtual void ActivateItem(RoutedEventArgs e) public virtual void ActivateItem(IPlatformRoutedEventArgs e)
{ {
} }
/// <summary> /// <summary>
/// Gets called when the item is clicked with the middle mouse button. /// Gets called when the item is clicked with the middle mouse button.
/// </summary> /// </summary>
public virtual void ActivateItemSecondary(RoutedEventArgs e) public virtual void ActivateItemSecondary(IPlatformRoutedEventArgs e)
{ {
} }

4
SharpTreeView/SharpTreeNodeCollection.cs → ICSharpCode.ILSpyX/TreeView/SharpTreeNodeCollection.cs

@ -22,7 +22,9 @@ using System.Collections.Specialized;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
namespace ICSharpCode.TreeView #nullable disable
namespace ICSharpCode.ILSpyX.TreeView
{ {
/// <summary> /// <summary>
/// Collection that validates that inserted nodes do not have another parent. /// Collection that validates that inserted nodes do not have another parent.

4
SharpTreeView/TreeFlattener.cs → ICSharpCode.ILSpyX/TreeView/TreeFlattener.cs

@ -22,7 +22,9 @@ using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using System.Diagnostics; using System.Diagnostics;
namespace ICSharpCode.TreeView #nullable disable
namespace ICSharpCode.ILSpyX.TreeView
{ {
sealed class TreeFlattener : IList, INotifyCollectionChanged sealed class TreeFlattener : IList, INotifyCollectionChanged
{ {

2
SharpTreeView/TreeTraversal.cs → ICSharpCode.ILSpyX/TreeView/TreeTraversal.cs

@ -19,7 +19,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpyX.TreeView
{ {
/// <summary> /// <summary>
/// Static helper methods for traversing trees. /// Static helper methods for traversing trees.

1
ILSpy.Wpf.slnf

@ -12,7 +12,6 @@
"ILSpy.ReadyToRun\\ILSpy.ReadyToRun.csproj", "ILSpy.ReadyToRun\\ILSpy.ReadyToRun.csproj",
"ILSpy.Tests\\ILSpy.Tests.csproj", "ILSpy.Tests\\ILSpy.Tests.csproj",
"ILSpy\\ILSpy.csproj", "ILSpy\\ILSpy.csproj",
"SharpTreeView\\ICSharpCode.TreeView.csproj",
"TestPlugin\\TestPlugin.csproj" "TestPlugin\\TestPlugin.csproj"
] ]
} }

8
ILSpy.sln

@ -12,8 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E7
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy", "ILSpy\ILSpy.csproj", "{1E85EFF9-E370-4683-83E4-8A3D063FF791}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy", "ILSpy\ILSpy.csproj", "{1E85EFF9-E370-4683-83E4-8A3D063FF791}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.TreeView", "SharpTreeView\ICSharpCode.TreeView.csproj", "{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler", "ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj", "{984CC812-9470-4A13-AFF9-CC44068D666C}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler", "ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj", "{984CC812-9470-4A13-AFF9-CC44068D666C}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Tests", "ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj", "{FEC0DA52-C4A6-4710-BE36-B484A20C5E22}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Tests", "ICSharpCode.Decompiler.Tests\ICSharpCode.Decompiler.Tests.csproj", "{FEC0DA52-C4A6-4710-BE36-B484A20C5E22}"
@ -36,7 +34,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.Decompiler.Test
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ILSpyX", "ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj", "{F8EFCF9D-B9A3-4BA0-A1B2-B026A71DAC22}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ILSpyX", "ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj", "{F8EFCF9D-B9A3-4BA0-A1B2-B026A71DAC22}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.BamlDecompiler", "ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj", "{81A30182-3378-4952-8880-F44822390040}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.BamlDecompiler", "ICSharpCode.BamlDecompiler\ICSharpCode.BamlDecompiler.csproj", "{81A30182-3378-4952-8880-F44822390040}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -48,10 +46,6 @@ Global
{1E85EFF9-E370-4683-83E4-8A3D063FF791}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E85EFF9-E370-4683-83E4-8A3D063FF791}.Release|Any CPU.ActiveCfg = Release|Any CPU {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E85EFF9-E370-4683-83E4-8A3D063FF791}.Release|Any CPU.Build.0 = Release|Any CPU {1E85EFF9-E370-4683-83E4-8A3D063FF791}.Release|Any CPU.Build.0 = Release|Any CPU
{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDE2A481-8271-4EAC-A330-8FA6A38D13D1}.Release|Any CPU.Build.0 = Release|Any CPU
{984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.Build.0 = Debug|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{984CC812-9470-4A13-AFF9-CC44068D666C}.Release|Any CPU.ActiveCfg = Release|Any CPU {984CC812-9470-4A13-AFF9-CC44068D666C}.Release|Any CPU.ActiveCfg = Release|Any CPU

5
ILSpy/Analyzers/AnalyzerEntityTreeNode.cs

@ -22,7 +22,8 @@ using System.Windows;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Analyzers namespace ICSharpCode.ILSpy.Analyzers
{ {
@ -33,7 +34,7 @@ namespace ICSharpCode.ILSpy.Analyzers
{ {
public abstract IEntity Member { get; } public abstract IEntity Member { get; }
public override void ActivateItem(System.Windows.RoutedEventArgs e) public override void ActivateItem(IPlatformRoutedEventArgs e)
{ {
e.Handled = true; e.Handled = true;
if (this.Member == null || this.Member.MetadataToken.IsNil) if (this.Member == null || this.Member.MetadataToken.IsNil)

4
ILSpy/Analyzers/AnalyzerTreeNode.cs

@ -21,7 +21,7 @@ using System.Collections.Specialized;
using System.Linq; using System.Linq;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Analyzers namespace ICSharpCode.ILSpy.Analyzers
{ {
@ -56,7 +56,7 @@ namespace ICSharpCode.ILSpy.Analyzers
DeleteCore(); DeleteCore();
} }
protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e) internal protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
{ {
if (e.NewItems != null) if (e.NewItems != null)
{ {

3
ILSpy/Analyzers/AnalyzerTreeView.cs

@ -27,7 +27,8 @@ using ICSharpCode.ILSpy.Analyzers.TreeNodes;
using ICSharpCode.ILSpy.Docking; using ICSharpCode.ILSpy.Docking;
using ICSharpCode.ILSpy.ViewModels; using ICSharpCode.ILSpy.ViewModels;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpy.Controls.TreeView;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Analyzers namespace ICSharpCode.ILSpy.Analyzers
{ {

3
ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs

@ -22,6 +22,7 @@ using System.Windows;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpyX.Analyzers; using ICSharpCode.ILSpyX.Analyzers;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.Analyzers.TreeNodes namespace ICSharpCode.ILSpy.Analyzers.TreeNodes
{ {
@ -52,7 +53,7 @@ namespace ICSharpCode.ILSpy.Analyzers.TreeNodes
} }
} }
public override void ActivateItem(RoutedEventArgs e) public override void ActivateItem(IPlatformRoutedEventArgs e)
{ {
e.Handled = true; e.Handled = true;
if (analyzedModule.MetadataFile == null) if (analyzedModule.MetadataFile == null)

3
ILSpy/App.xaml.cs

@ -40,6 +40,7 @@ using Medo.Application;
using Microsoft.VisualStudio.Composition; using Microsoft.VisualStudio.Composition;
using TomsToolbox.Wpf.Styles; using TomsToolbox.Wpf.Styles;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy namespace ICSharpCode.ILSpy
{ {
@ -75,6 +76,8 @@ namespace ICSharpCode.ILSpy
SingleInstance.NewInstanceDetected += SingleInstance_NewInstanceDetected; SingleInstance.NewInstanceDetected += SingleInstance_NewInstanceDetected;
} }
SharpTreeNode.SetImagesProvider(new WpfWindowsTreeNodeImagesProvider());
InitializeComponent(); InitializeComponent();
Resources.RegisterDefaultStyles(); Resources.RegisterDefaultStyles();

2
ILSpy/Commands/SaveCodeContextMenuEntry.cs

@ -27,9 +27,9 @@ using ICSharpCode.ILSpy.Options;
using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpy.TreeNodes; using ICSharpCode.ILSpy.TreeNodes;
using ICSharpCode.ILSpy.ViewModels; using ICSharpCode.ILSpy.ViewModels;
using ICSharpCode.TreeView;
using Microsoft.Win32; using Microsoft.Win32;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TextView namespace ICSharpCode.ILSpy.TextView
{ {

2
ILSpy/Commands/SortAssemblyListCommand.cs

@ -21,7 +21,7 @@ using System.Collections.Generic;
using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.Properties;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy namespace ICSharpCode.ILSpy
{ {

3
ILSpy/ContextMenuEntry.cs

@ -28,7 +28,8 @@ using System.Windows.Media;
using ICSharpCode.AvalonEdit; using ICSharpCode.AvalonEdit;
using ICSharpCode.ILSpy.TextView; using ICSharpCode.ILSpy.TextView;
using ICSharpCode.ILSpyX.Search; using ICSharpCode.ILSpyX.Search;
using ICSharpCode.TreeView; using ICSharpCode.ILSpy.Controls.TreeView;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy namespace ICSharpCode.ILSpy
{ {

2
SharpTreeView/Converters.cs → ILSpy/Controls/TreeView/Converters.cs

@ -22,7 +22,7 @@ using System.Windows;
using System.Windows.Data; using System.Windows.Data;
using System.Windows.Markup; using System.Windows.Markup;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class CollapsedWhenFalse : MarkupExtension, IValueConverter public class CollapsedWhenFalse : MarkupExtension, IValueConverter
{ {

4
SharpTreeView/EditTextBox.cs → ILSpy/Controls/TreeView/EditTextBox.cs

@ -20,7 +20,9 @@ using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
namespace ICSharpCode.TreeView using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
class EditTextBox : TextBox class EditTextBox : TextBox
{ {

2
SharpTreeView/ExtensionMethods.cs → ILSpy/Controls/TreeView/ExtensionMethods.cs

@ -22,7 +22,7 @@ using System.Linq;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
static class ExtensionMethods static class ExtensionMethods
{ {

2
SharpTreeView/GeneralAdorner.cs → ILSpy/Controls/TreeView/GeneralAdorner.cs

@ -20,7 +20,7 @@ using System.Windows;
using System.Windows.Documents; using System.Windows.Documents;
using System.Windows.Media; using System.Windows.Media;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class GeneralAdorner : Adorner public class GeneralAdorner : Adorner
{ {

2
SharpTreeView/InsertMarker.cs → ILSpy/Controls/TreeView/InsertMarker.cs

@ -19,7 +19,7 @@
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class InsertMarker : Control public class InsertMarker : Control
{ {

2
SharpTreeView/LinesRenderer.cs → ILSpy/Controls/TreeView/LinesRenderer.cs

@ -20,7 +20,7 @@ using System.Diagnostics;
using System.Windows; using System.Windows;
using System.Windows.Media; using System.Windows.Media;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
class LinesRenderer : FrameworkElement class LinesRenderer : FrameworkElement
{ {

2
SharpTreeView/SharpGridView.cs → ILSpy/Controls/TreeView/SharpGridView.cs

@ -19,7 +19,7 @@
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class SharpGridView : GridView public class SharpGridView : GridView
{ {

5
SharpTreeView/SharpTreeNodeView.cs → ILSpy/Controls/TreeView/SharpTreeNodeView.cs

@ -16,7 +16,6 @@
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
using System;
using System.ComponentModel; using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.Windows; using System.Windows;
@ -24,7 +23,9 @@ using System.Windows.Controls;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
using System.Windows.Media; using System.Windows.Media;
namespace ICSharpCode.TreeView using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class SharpTreeNodeView : Control public class SharpTreeNodeView : Control
{ {

16
SharpTreeView/SharpTreeView.cs → ILSpy/Controls/TreeView/SharpTreeView.cs

@ -28,7 +28,9 @@ using System.Windows.Documents;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Threading; using System.Windows.Threading;
namespace ICSharpCode.TreeView using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class SharpTreeView : ListView public class SharpTreeView : ListView
{ {
@ -303,7 +305,7 @@ namespace ICSharpCode.TreeView
if (container != null && Keyboard.Modifiers == ModifierKeys.None && this.SelectedItems.Count == 1 && this.SelectedItem == container.Node) if (container != null && Keyboard.Modifiers == ModifierKeys.None && this.SelectedItems.Count == 1 && this.SelectedItem == container.Node)
{ {
e.Handled = true; e.Handled = true;
container.Node.ActivateItem(e); container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e));
} }
break; break;
case Key.Space: case Key.Space:
@ -319,7 +321,7 @@ namespace ICSharpCode.TreeView
} }
else else
{ {
container.Node.ActivateItem(e); container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e));
} }
} }
break; break;
@ -462,7 +464,7 @@ namespace ICSharpCode.TreeView
if (Root != null && !ShowRoot) if (Root != null && !ShowRoot)
{ {
e.Handled = true; e.Handled = true;
Root.CanDrop(e, Root.Children.Count); Root.CanDrop(new WpfWindowsDragEventArgs(e), Root.Children.Count);
} }
} }
@ -473,7 +475,7 @@ namespace ICSharpCode.TreeView
if (Root != null && !ShowRoot) if (Root != null && !ShowRoot)
{ {
e.Handled = true; e.Handled = true;
Root.InternalDrop(e, Root.Children.Count); Root.InternalDrop(new WpfWindowsDragEventArgs(e), Root.Children.Count);
} }
} }
@ -504,7 +506,7 @@ namespace ICSharpCode.TreeView
if (target != null) if (target != null)
{ {
e.Handled = true; e.Handled = true;
target.Node.InternalDrop(e, target.Index); target.Node.InternalDrop(new WpfWindowsDragEventArgs(e), target.Index);
} }
} }
catch (Exception ex) catch (Exception ex)
@ -612,7 +614,7 @@ namespace ICSharpCode.TreeView
if (node != null) if (node != null)
{ {
e.Effects = DragDropEffects.None; e.Effects = DragDropEffects.None;
if (node.CanDrop(e, index)) if (node.CanDrop(new WpfWindowsDragEventArgs(e), index))
{ {
DropTarget target = new DropTarget() { DropTarget target = new DropTarget() {
Item = item, Item = item,

2
SharpTreeView/Themes/Generic.xaml → ILSpy/Controls/TreeView/SharpTreeView.xaml

@ -1,6 +1,6 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Default="clr-namespace:ICSharpCode.TreeView" xmlns:Default="clr-namespace:ICSharpCode.ILSpy.Controls.TreeView"
xmlns:styles="urn:TomsToolbox.Wpf.Styles"> xmlns:styles="urn:TomsToolbox.Wpf.Styles">
<Style x:Key="ExpandCollapseToggleStyle" <Style x:Key="ExpandCollapseToggleStyle"

2
SharpTreeView/SharpTreeViewAutomationPeer.cs → ILSpy/Controls/TreeView/SharpTreeViewAutomationPeer.cs

@ -18,7 +18,7 @@
using System.Windows.Automation.Peers; using System.Windows.Automation.Peers;
namespace ICSharpCode.TreeView namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
class SharpTreeViewAutomationPeer : FrameworkElementAutomationPeer class SharpTreeViewAutomationPeer : FrameworkElementAutomationPeer
{ {

10
SharpTreeView/SharpTreeViewItem.cs → ILSpy/Controls/TreeView/SharpTreeViewItem.cs

@ -22,7 +22,9 @@ using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
namespace ICSharpCode.TreeView using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
public class SharpTreeViewItem : ListViewItem public class SharpTreeViewItem : ListViewItem
{ {
@ -103,7 +105,7 @@ namespace ICSharpCode.TreeView
var selection = ParentTreeView.GetTopLevelSelection().ToArray(); var selection = ParentTreeView.GetTopLevelSelection().ToArray();
if (Node.CanDrag(selection)) if (Node.CanDrag(selection))
{ {
Node.StartDrag(this, selection); Node.StartDrag(this, selection, new WpfWindowsDragDropManager());
} }
} }
} }
@ -114,7 +116,7 @@ namespace ICSharpCode.TreeView
if (wasDoubleClick) if (wasDoubleClick)
{ {
wasDoubleClick = false; wasDoubleClick = false;
Node.ActivateItem(e); Node.ActivateItem(new WpfWindowsRoutedEventArgs(e));
if (!e.Handled) if (!e.Handled)
{ {
if (!Node.IsRoot || ParentTreeView.ShowRootExpander) if (!Node.IsRoot || ParentTreeView.ShowRootExpander)
@ -135,7 +137,7 @@ namespace ICSharpCode.TreeView
{ {
if (e.ChangedButton == MouseButton.Middle) if (e.ChangedButton == MouseButton.Middle)
{ {
Node.ActivateItemSecondary(e); Node.ActivateItemSecondary(new WpfWindowsRoutedEventArgs(e));
} }
else else
{ {

4
SharpTreeView/SharpTreeViewItemAutomationPeer.cs → ILSpy/Controls/TreeView/SharpTreeViewItemAutomationPeer.cs

@ -22,7 +22,9 @@ using System.Windows.Automation;
using System.Windows.Automation.Peers; using System.Windows.Automation.Peers;
using System.Windows.Automation.Provider; using System.Windows.Automation.Provider;
namespace ICSharpCode.TreeView using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
class SharpTreeViewItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider class SharpTreeViewItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider
{ {

9
SharpTreeView/SharpTreeViewTextSearch.cs → ILSpy/Controls/TreeView/SharpTreeViewTextSearch.cs

@ -22,7 +22,9 @@ using System.Runtime.InteropServices;
using System.Windows; using System.Windows;
using System.Windows.Threading; using System.Windows.Threading;
namespace ICSharpCode.TreeView using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.Controls.TreeView
{ {
/// <summary> /// <summary>
/// Custom TextSearch-implementation. /// Custom TextSearch-implementation.
@ -30,9 +32,6 @@ namespace ICSharpCode.TreeView
/// </summary> /// </summary>
public partial class SharpTreeViewTextSearch : DependencyObject public partial class SharpTreeViewTextSearch : DependencyObject
{ {
[LibraryImport("user32.dll")]
internal static partial int GetDoubleClickTime();
static readonly DependencyPropertyKey TextSearchInstancePropertyKey = DependencyProperty.RegisterAttachedReadOnly("TextSearchInstance", static readonly DependencyPropertyKey TextSearchInstancePropertyKey = DependencyProperty.RegisterAttachedReadOnly("TextSearchInstance",
typeof(SharpTreeViewTextSearch), typeof(SharpTreeViewTextSearch), new FrameworkPropertyMetadata(null)); typeof(SharpTreeViewTextSearch), typeof(SharpTreeViewTextSearch), new FrameworkPropertyMetadata(null));
static readonly DependencyProperty TextSearchInstanceProperty = TextSearchInstancePropertyKey.DependencyProperty; static readonly DependencyProperty TextSearchInstanceProperty = TextSearchInstancePropertyKey.DependencyProperty;
@ -167,7 +166,7 @@ namespace ICSharpCode.TreeView
{ {
timer.Stop(); timer.Stop();
} }
timer.Interval = TimeSpan.FromMilliseconds(GetDoubleClickTime() * 2); timer.Interval = TimeSpan.FromMilliseconds(NativeMethods.GetDoubleClickTime() * 2);
timer.Start(); timer.Start();
} }
} }

31
ILSpy/Controls/TreeView/WpfWindowsDataObject.cs

@ -0,0 +1,31 @@
using System.Windows;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.Controls.TreeView
{
public class WpfWindowsDataObject : IPlatformDataObject
{
private readonly IDataObject _dataObject;
public WpfWindowsDataObject(IDataObject dataObject)
{
_dataObject = dataObject;
}
public object GetData(string format)
{
return _dataObject.GetData(format);
}
public bool GetDataPresent(string format)
{
return _dataObject.GetDataPresent(format);
}
public void SetData(string format, object data)
{
_dataObject.SetData(format, data);
}
}
}

14
ILSpy/Controls/TreeView/WpfWindowsDragDropManager.cs

@ -0,0 +1,14 @@
using System.Windows;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.Controls.TreeView
{
public class WpfWindowsDragDropManager : IPlatformDragDrop
{
public XPlatDragDropEffects DoDragDrop(object dragSource, object data, XPlatDragDropEffects allowedEffects)
{
return (XPlatDragDropEffects)DragDrop.DoDragDrop(dragSource as DependencyObject, data, (DragDropEffects)allowedEffects);
}
}
}

20
ILSpy/Controls/TreeView/WpfWindowsDragEventArgs.cs

@ -0,0 +1,20 @@
using System.Windows;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.Controls.TreeView
{
public class WpfWindowsDragEventArgs : IPlatformDragEventArgs
{
private readonly DragEventArgs _eventArgs;
public WpfWindowsDragEventArgs(DragEventArgs eventArgs)
{
_eventArgs = eventArgs;
}
public XPlatDragDropEffects Effects { get => (XPlatDragDropEffects)_eventArgs.Effects; set => _eventArgs.Effects = (DragDropEffects)value; }
public IPlatformDataObject Data => new WpfWindowsDataObject(_eventArgs.Data);
}
}

18
ILSpy/Controls/TreeView/WpfWindowsRoutedEventArgs.cs

@ -0,0 +1,18 @@
using System.Windows;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.Controls.TreeView
{
public class WpfWindowsRoutedEventArgs : IPlatformRoutedEventArgs
{
private readonly RoutedEventArgs _eventArgs;
public WpfWindowsRoutedEventArgs(RoutedEventArgs eventArgs)
{
_eventArgs = eventArgs;
}
public bool Handled { get => _eventArgs.Handled; set => _eventArgs.Handled = value; }
}
}

1
ILSpy/ILSpy.csproj

@ -86,7 +86,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" /> <ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" /> <ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" />
<ProjectReference Include="..\SharpTreeView\ICSharpCode.TreeView.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug'"> <ItemGroup Condition="'$(Configuration)' == 'Debug'">

9
ILSpy/Images/WpfWindowsTreeNodeImagesProvider.cs

@ -0,0 +1,9 @@
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy
{
public class WpfWindowsTreeNodeImagesProvider : ITreeNodeImagesProvider
{
public object Assembly => Images.Assembly;
}
}

4
ILSpy/MainWindow.xaml

@ -2,7 +2,9 @@
<Window <Window
x:Class="ICSharpCode.ILSpy.MainWindow" x:Class="ICSharpCode.ILSpy.MainWindow"
x:ClassModifier="public" x:ClassModifier="public"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:tv="clr-namespace:ICSharpCode.TreeView;assembly=ICSharpCode.TreeView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:tv="clr-namespace:ICSharpCode.ILSpy.Controls.TreeView"
xmlns:local="clr-namespace:ICSharpCode.ILSpy" xmlns:local="clr-namespace:ICSharpCode.ILSpy"
xmlns:search="clr-namespace:ICSharpCode.ILSpy.Search" xmlns:search="clr-namespace:ICSharpCode.ILSpy.Search"
xmlns:avalondock="https://github.com/Dirkster99/AvalonDock" xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"

3
ILSpy/MainWindow.xaml.cs

@ -57,9 +57,10 @@ using ICSharpCode.ILSpy.ViewModels;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.ILSpyX.FileLoaders; using ICSharpCode.ILSpyX.FileLoaders;
using ICSharpCode.ILSpyX.Settings; using ICSharpCode.ILSpyX.Settings;
using ICSharpCode.TreeView; using ICSharpCode.ILSpy.Controls.TreeView;
using Microsoft.Win32; using Microsoft.Win32;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy namespace ICSharpCode.ILSpy
{ {

3
ILSpy/NativeMethods.cs

@ -26,6 +26,9 @@ namespace ICSharpCode.ILSpy
{ {
const int S_OK = 0; const int S_OK = 0;
[LibraryImport("user32.dll")]
internal static partial int GetDoubleClickTime();
[LibraryImport("dwmapi.dll")] [LibraryImport("dwmapi.dll")]
internal static partial int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize); internal static partial int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize);

2
ILSpy/NavigationState.cs

@ -22,7 +22,7 @@ using System.Diagnostics;
using ICSharpCode.ILSpy.TextView; using ICSharpCode.ILSpy.TextView;
using ICSharpCode.ILSpy.ViewModels; using ICSharpCode.ILSpy.ViewModels;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy namespace ICSharpCode.ILSpy
{ {

1
ILSpy/Themes/generic.xaml

@ -5,6 +5,7 @@
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" /> <ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" />
<ResourceDictionary Source="../Controls/ZoomScrollViewer.xaml" /> <ResourceDictionary Source="../Controls/ZoomScrollViewer.xaml" />
<ResourceDictionary Source="../Controls/TreeView/SharpTreeView.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<!-- SortableGridViewColumn. <!-- SortableGridViewColumn.

13
ILSpy/TreeNodes/AssemblyListTreeNode.cs

@ -26,7 +26,8 @@ using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.Decompiler.Util; using ICSharpCode.Decompiler.Util;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
@ -81,21 +82,21 @@ namespace ICSharpCode.ILSpy.TreeNodes
}; };
} }
public override bool CanDrop(DragEventArgs e, int index) public override bool CanDrop(IPlatformDragEventArgs e, int index)
{ {
e.Effects = DragDropEffects.Move | DragDropEffects.Copy | DragDropEffects.Link; e.Effects = XPlatDragDropEffects.Move | XPlatDragDropEffects.Copy | XPlatDragDropEffects.Link;
if (e.Data.GetDataPresent(AssemblyTreeNode.DataFormat)) if (e.Data.GetDataPresent(AssemblyTreeNode.DataFormat))
return true; return true;
else if (e.Data.GetDataPresent(DataFormats.FileDrop)) else if (e.Data.GetDataPresent(DataFormats.FileDrop))
return true; return true;
else else
{ {
e.Effects = DragDropEffects.None; e.Effects = XPlatDragDropEffects.None;
return false; return false;
} }
} }
public override void Drop(DragEventArgs e, int index) public override void Drop(IPlatformDragEventArgs e, int index)
{ {
string[] files = e.Data.GetData(AssemblyTreeNode.DataFormat) as string[]; string[] files = e.Data.GetData(AssemblyTreeNode.DataFormat) as string[];
if (files == null) if (files == null)
@ -186,7 +187,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
if (bundle == null) if (bundle == null)
return null; return null;
bundle.EnsureLazyChildren(); bundle.EnsureLazyChildren();
foreach (var node in TreeTraversal.PreOrder(bundle.Children, ExpandAndGetChildren).OfType<AssemblyTreeNode>()) foreach (var node in ILSpyX.TreeView.TreeTraversal.PreOrder(bundle.Children, ExpandAndGetChildren).OfType<AssemblyTreeNode>())
{ {
if (node.LoadedAssembly == asm) if (node.LoadedAssembly == asm)
return node; return node;

7
ILSpy/TreeNodes/AssemblyReferenceTreeNode.cs

@ -22,6 +22,9 @@ using System.Windows.Threading;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
using TomsToolbox.Wpf.Controls;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
@ -48,7 +51,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
get { return Language.EscapeName(r.Name) + GetSuffixString(r.Handle); } get { return Language.EscapeName(r.Name) + GetSuffixString(r.Handle); }
} }
public override object Icon => Images.Assembly; public override object Icon => ImagesProvider.Assembly;
public override bool ShowExpander { public override bool ShowExpander {
get { get {
@ -66,7 +69,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
} }
} }
public override void ActivateItem(System.Windows.RoutedEventArgs e) public override void ActivateItem(IPlatformRoutedEventArgs e)
{ {
if (parentAssembly.Parent is AssemblyListTreeNode assemblyListNode) if (parentAssembly.Parent is AssemblyListTreeNode assemblyListNode)
{ {

12
ILSpy/TreeNodes/AssemblyTreeNode.cs

@ -35,11 +35,13 @@ using ICSharpCode.ILSpy.ViewModels;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.ILSpyX.FileLoaders; using ICSharpCode.ILSpyX.FileLoaders;
using ICSharpCode.ILSpyX.PdbProvider; using ICSharpCode.ILSpyX.PdbProvider;
using ICSharpCode.TreeView; using ICSharpCode.ILSpy.Controls.TreeView;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
using Microsoft.Win32; using Microsoft.Win32;
using TypeDefinitionHandle = System.Reflection.Metadata.TypeDefinitionHandle; using TypeDefinitionHandle = System.Reflection.Metadata.TypeDefinitionHandle;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
@ -410,9 +412,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
return nodes.All(n => n is AssemblyTreeNode { PackageEntry: null }); return nodes.All(n => n is AssemblyTreeNode { PackageEntry: null });
} }
public override void StartDrag(DependencyObject dragSource, SharpTreeNode[] nodes) public override void StartDrag(object dragSource, SharpTreeNode[] nodes, IPlatformDragDrop dragdropManager)
{ {
DragDrop.DoDragDrop(dragSource, Copy(nodes), DragDropEffects.All); dragdropManager.DoDragDrop(dragSource, Copy(nodes), XPlatDragDropEffects.All);
} }
public override bool CanDelete() public override bool CanDelete()
@ -433,9 +435,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
internal const string DataFormat = "ILSpyAssemblies"; internal const string DataFormat = "ILSpyAssemblies";
public override IDataObject Copy(SharpTreeNode[] nodes) public override IPlatformDataObject Copy(SharpTreeNode[] nodes)
{ {
DataObject dataObject = new DataObject(); var dataObject = new WpfWindowsDataObject(new DataObject());
dataObject.SetData(DataFormat, nodes.OfType<AssemblyTreeNode>().Select(n => n.LoadedAssembly.FileName).ToArray()); dataObject.SetData(DataFormat, nodes.OfType<AssemblyTreeNode>().Select(n => n.LoadedAssembly.FileName).ToArray());
return dataObject; return dataObject;
} }

5
ILSpy/TreeNodes/BaseTypesEntryNode.cs

@ -20,7 +20,8 @@ using System.Linq;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
@ -37,7 +38,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override object Icon => type.Kind == TypeKind.Interface ? Images.Interface : Images.Class; public override object Icon => type.Kind == TypeKind.Interface ? Images.Interface : Images.Class;
public override void ActivateItem(System.Windows.RoutedEventArgs e) public override void ActivateItem(IPlatformRoutedEventArgs e)
{ {
e.Handled = ActivateItem(this, type); e.Handled = ActivateItem(this, type);
} }

2
ILSpy/TreeNodes/BaseTypesTreeNode.cs

@ -25,7 +25,7 @@ using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {

3
ILSpy/TreeNodes/DerivedTypesEntryNode.cs

@ -26,6 +26,7 @@ using ICSharpCode.ILSpyX;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
class DerivedTypesEntryNode : ILSpyTreeNode, IMemberTreeNode class DerivedTypesEntryNode : ILSpyTreeNode, IMemberTreeNode
{ {
@ -89,7 +90,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
return DerivedTypesTreeNode.FindDerivedTypes(list, type, ct); return DerivedTypesTreeNode.FindDerivedTypes(list, type, ct);
} }
public override void ActivateItem(System.Windows.RoutedEventArgs e) public override void ActivateItem(IPlatformRoutedEventArgs e)
{ {
e.Handled = BaseTypesEntryNode.ActivateItem(this, type); e.Handled = BaseTypesEntryNode.ActivateItem(this, type);
} }

9
ILSpy/TreeNodes/ILSpyTreeNode.cs

@ -23,14 +23,13 @@ using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Reflection.Metadata; using System.Reflection.Metadata;
using System.Reflection.Metadata.Ecma335; using System.Reflection.Metadata.Ecma335;
using System.Windows;
using System.Windows.Threading; using System.Windows.Threading;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.Decompiler.TypeSystem;
using ICSharpCode.ILSpy.Options;
using ICSharpCode.ILSpyX.Abstractions; using ICSharpCode.ILSpyX.Abstractions;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
@ -77,7 +76,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
return false; return false;
} }
public override void ActivateItemSecondary(RoutedEventArgs e) public override void ActivateItemSecondary(IPlatformRoutedEventArgs e)
{ {
MainWindow.Instance.SelectNode(this, inNewTabPage: true); MainWindow.Instance.SelectNode(this, inNewTabPage: true);
MainWindow.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)MainWindow.Instance.RefreshDecompiledView); MainWindow.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)MainWindow.Instance.RefreshDecompiledView);
@ -93,7 +92,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
return false; return false;
} }
protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e) internal protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
{ {
if (e.NewItems != null) if (e.NewItems != null)
{ {

3
ILSpy/TreeNodes/ModuleReferenceTreeNode.cs

@ -21,6 +21,7 @@ using System.Reflection.Metadata;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.Decompiler.Metadata; using ICSharpCode.Decompiler.Metadata;
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {
@ -69,7 +70,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override object Icon => Images.Library; public override object Icon => Images.Library;
public override void ActivateItem(System.Windows.RoutedEventArgs e) public override void ActivateItem(IPlatformRoutedEventArgs e)
{ {
var assemblyListNode = parentAssembly.Parent as AssemblyListTreeNode; var assemblyListNode = parentAssembly.Parent as AssemblyListTreeNode;
if (assemblyListNode != null && containsMetadata) if (assemblyListNode != null && containsMetadata)

2
ILSpy/TreeNodes/PackageFolderTreeNode.cs

@ -22,7 +22,7 @@ using System.Linq;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.ILSpyX; using ICSharpCode.ILSpyX;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {

2
ILSpy/TreeNodes/ThreadingSupport.cs

@ -28,7 +28,7 @@ using System.Windows.Threading;
using ICSharpCode.Decompiler; using ICSharpCode.Decompiler;
using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpy.Properties;
using ICSharpCode.TreeView; using ICSharpCode.ILSpyX.TreeView;
namespace ICSharpCode.ILSpy.TreeNodes namespace ICSharpCode.ILSpy.TreeNodes
{ {

28
SharpTreeView/ICSharpCode.TreeView.csproj

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<UseWpf>true</UseWpf>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<SignAssembly>True</SignAssembly>
<TargetFramework>net8.0-windows</TargetFramework>
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="TomsToolbox.Wpf.Styles" />
</ItemGroup>
</Project>

54
SharpTreeView/Properties/AssemblyInfo.cs

@ -1,54 +0,0 @@
// Copyright (c) 2020 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
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
using System.Reflection;
using System.Windows;
using System.Windows.Markup;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ICSharpCode.TreeView")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
[assembly: XmlnsPrefix("http://icsharpcode.net/sharpdevelop/treeview", "treeview")]
[assembly: XmlnsDefinition("http://icsharpcode.net/sharpdevelop/treeview", "ICSharpCode.TreeView")]

51
SharpTreeView/Properties/GlobalAssemblyInfo.cs

@ -1,51 +0,0 @@
// Copyright (c) 2020 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
// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
// //
// DO NOT EDIT GlobalAssemblyInfo.cs, it is recreated using AssemblyInfo.template whenever //
// ICSharpCode.Core is compiled. //
// //
/////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////
using System.Reflection;
using System.Resources;
[assembly: System.Runtime.InteropServices.ComVisible(false)]
[assembly: AssemblyCompany("ic#code")]
[assembly: AssemblyProduct("SharpDevelop")]
[assembly: AssemblyCopyright("2000-2012 AlphaSierraPapa for the SharpDevelop Team")]
[assembly: AssemblyVersion(RevisionClass.Major + "." + RevisionClass.Minor + "." + RevisionClass.Build + "." + RevisionClass.Revision)]
[assembly: AssemblyInformationalVersion(RevisionClass.FullVersion + "-ca8a8e28")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
internal static class RevisionClass
{
public const string Major = "4";
public const string Minor = "2";
public const string Build = "0";
public const string Revision = "8752";
public const string VersionName = "Beta 2";
public const string FullVersion = Major + "." + Minor + "." + Build + ".8752-Beta 2";
}
Loading…
Cancel
Save