mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 02:15:58 +00:00
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
This commit is contained in:
@@ -5,16 +5,16 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<WarningsAsErrors>nullable</WarningsAsErrors>
|
||||
|
||||
|
||||
<SignAssembly>True</SignAssembly>
|
||||
<AssemblyOriginatorKeyFile>..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk</AssemblyOriginatorKeyFile>
|
||||
|
||||
|
||||
<NeutralLanguage>en-US</NeutralLanguage>
|
||||
<GenerateAssemblyVersionAttribute>False</GenerateAssemblyVersionAttribute>
|
||||
<GenerateAssemblyFileVersionAttribute>False</GenerateAssemblyFileVersionAttribute>
|
||||
<GenerateAssemblyInformationalVersionAttribute>False</GenerateAssemblyInformationalVersionAttribute>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageId>ICSharpCode.ILSpyX</PackageId>
|
||||
<PackageVersion>8.0.0.0-noversion</PackageVersion>
|
||||
@@ -32,22 +32,27 @@
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<Copyright>Copyright 2022-$([System.DateTime]::Now.Year) AlphaSierraPapa</Copyright>
|
||||
<PackageTags>C# Decompiler ILSpy</PackageTags>
|
||||
|
||||
|
||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||
<DebugType>embedded</DebugType>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<InternalsVisibleTo Include="ILSpy" Key="00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf" />
|
||||
<InternalsVisibleTo Include="ILSpy.Tests" Key="00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="PackageReadme.md" Pack="true" PackagePath="\" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="Properties\AssemblyInfo.template.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
|
||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||
</PropertyGroup>
|
||||
@@ -77,7 +82,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
<Target Name="ILSpyUpdateAssemblyInfo" AfterTargets="ResolveProjectReferences">
|
||||
<ReadLinesFromFile ContinueOnError="true" File="..\VERSION">
|
||||
<Output TaskParameter="Lines" PropertyName="PackageVersion" />
|
||||
|
||||
@@ -19,7 +19,3 @@ using System.Runtime.Versioning;
|
||||
|
||||
[assembly: SuppressMessage("Microsoft.Usage", "CA2243:AttributeStringLiteralsShouldParseCorrectly",
|
||||
Justification = "AssemblyInformationalVersion does not need to be a parsable version")]
|
||||
|
||||
[assembly: InternalsVisibleTo("ILSpy, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")]
|
||||
[assembly: InternalsVisibleTo("ILSpy.Tests, PublicKey=00240000048000009400000006020000002400005253413100040000010001004dcf3979c4e902efa4dd2163a039701ed5822e6f1134d77737296abbb97bf0803083cfb2117b4f5446a217782f5c7c634f9fe1fc60b4c11d62c5b3d33545036706296d31903ddcf750875db38a8ac379512f51620bb948c94d0831125fbc5fe63707cbb93f48c1459c4d1749eb7ac5e681a2f0d6d7c60fa527a3c0b8f92b02bf")]
|
||||
|
||||
|
||||
@@ -20,7 +20,9 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
#nullable disable
|
||||
|
||||
namespace ICSharpCode.ILSpyX.TreeView
|
||||
{
|
||||
// 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.
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
|
||||
{
|
||||
public interface IPlatformDragDrop
|
||||
{
|
||||
XPlatDragDropEffects DoDragDrop(object dragSource, object data, XPlatDragDropEffects allowedEffects);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
|
||||
{
|
||||
public interface IPlatformDragEventArgs
|
||||
{
|
||||
XPlatDragDropEffects Effects { get; set; }
|
||||
IPlatformDataObject Data { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
|
||||
{
|
||||
public interface IPlatformRoutedEventArgs
|
||||
{
|
||||
bool Handled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions
|
||||
{
|
||||
public interface ITreeNodeImagesProvider
|
||||
{
|
||||
object Assembly { get; }
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -22,14 +22,18 @@ using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
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
|
||||
{
|
||||
protected static ITreeNodeImagesProvider ImagesProvider { get; private set; }
|
||||
public static void SetImagesProvider(ITreeNodeImagesProvider provider) => ImagesProvider = provider;
|
||||
|
||||
SharpTreeNodeCollection modelChildren;
|
||||
internal SharpTreeNode modelParent;
|
||||
bool isVisible = true;
|
||||
@@ -584,7 +588,7 @@ namespace ICSharpCode.TreeView
|
||||
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");
|
||||
}
|
||||
@@ -614,25 +618,26 @@ namespace ICSharpCode.TreeView
|
||||
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()))
|
||||
effects &= ~DragDropEffects.Move;
|
||||
DragDropEffects result = DragDrop.DoDragDrop(dragSource, Copy(nodes), effects);
|
||||
if (result == DragDropEffects.Move)
|
||||
effects &= ~XPlatDragDropEffects.Move;
|
||||
|
||||
XPlatDragDropEffects result = dragdropManager.DoDragDrop(dragSource, Copy(nodes), effects);
|
||||
if (result == XPlatDragDropEffects.Move)
|
||||
{
|
||||
foreach (SharpTreeNode node in nodes)
|
||||
node.DeleteCore();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool CanDrop(DragEventArgs e, int index)
|
||||
public virtual bool CanDrop(IPlatformDragEventArgs e, int index)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
internal void InternalDrop(DragEventArgs e, int index)
|
||||
internal void InternalDrop(IPlatformDragEventArgs e, int index)
|
||||
{
|
||||
if (LazyLoading)
|
||||
{
|
||||
@@ -643,7 +648,7 @@ namespace ICSharpCode.TreeView
|
||||
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()");
|
||||
}
|
||||
@@ -703,14 +708,14 @@ namespace ICSharpCode.TreeView
|
||||
/// <summary>
|
||||
/// Gets called when the item is double-clicked.
|
||||
/// </summary>
|
||||
public virtual void ActivateItem(RoutedEventArgs e)
|
||||
public virtual void ActivateItem(IPlatformRoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets called when the item is clicked with the middle mouse button.
|
||||
/// </summary>
|
||||
public virtual void ActivateItemSecondary(RoutedEventArgs e)
|
||||
public virtual void ActivateItemSecondary(IPlatformRoutedEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
+3
-1
@@ -22,7 +22,9 @@ using System.Collections.Specialized;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
#nullable disable
|
||||
|
||||
namespace ICSharpCode.ILSpyX.TreeView
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection that validates that inserted nodes do not have another parent.
|
||||
@@ -22,7 +22,9 @@ using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
#nullable disable
|
||||
|
||||
namespace ICSharpCode.ILSpyX.TreeView
|
||||
{
|
||||
sealed class TreeFlattener : IList, INotifyCollectionChanged
|
||||
{
|
||||
@@ -19,7 +19,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpyX.TreeView
|
||||
{
|
||||
/// <summary>
|
||||
/// Static helper methods for traversing trees.
|
||||
@@ -12,7 +12,6 @@
|
||||
"ILSpy.ReadyToRun\\ILSpy.ReadyToRun.csproj",
|
||||
"ILSpy.Tests\\ILSpy.Tests.csproj",
|
||||
"ILSpy\\ILSpy.csproj",
|
||||
"SharpTreeView\\ICSharpCode.TreeView.csproj",
|
||||
"TestPlugin\\TestPlugin.csproj"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -12,8 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "doc", "doc", "{F45DB999-7E7
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ILSpy", "ILSpy\ILSpy.csproj", "{1E85EFF9-E370-4683-83E4-8A3D063FF791}"
|
||||
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}"
|
||||
EndProject
|
||||
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
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ICSharpCode.ILSpyX", "ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj", "{F8EFCF9D-B9A3-4BA0-A1B2-B026A71DAC22}"
|
||||
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
|
||||
Global
|
||||
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}.Release|Any CPU.ActiveCfg = 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.Build.0 = Debug|Any CPU
|
||||
{984CC812-9470-4A13-AFF9-CC44068D666C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -22,7 +22,8 @@ using System.Windows;
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.ILSpy.TreeNodes;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Analyzers
|
||||
{
|
||||
@@ -33,7 +34,7 @@ namespace ICSharpCode.ILSpy.Analyzers
|
||||
{
|
||||
public abstract IEntity Member { get; }
|
||||
|
||||
public override void ActivateItem(System.Windows.RoutedEventArgs e)
|
||||
public override void ActivateItem(IPlatformRoutedEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
if (this.Member == null || this.Member.MetadataToken.IsNil)
|
||||
|
||||
@@ -21,7 +21,7 @@ using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Analyzers
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace ICSharpCode.ILSpy.Analyzers
|
||||
DeleteCore();
|
||||
}
|
||||
|
||||
protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
|
||||
internal protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.NewItems != null)
|
||||
{
|
||||
|
||||
@@ -27,7 +27,8 @@ using ICSharpCode.ILSpy.Analyzers.TreeNodes;
|
||||
using ICSharpCode.ILSpy.Docking;
|
||||
using ICSharpCode.ILSpy.ViewModels;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpy.Controls.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Analyzers
|
||||
{
|
||||
|
||||
@@ -22,6 +22,7 @@ using System.Windows;
|
||||
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.ILSpyX.Analyzers;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
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;
|
||||
if (analyzedModule.MetadataFile == null)
|
||||
|
||||
@@ -40,6 +40,7 @@ using Medo.Application;
|
||||
using Microsoft.VisualStudio.Composition;
|
||||
|
||||
using TomsToolbox.Wpf.Styles;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy
|
||||
{
|
||||
@@ -75,6 +76,8 @@ namespace ICSharpCode.ILSpy
|
||||
SingleInstance.NewInstanceDetected += SingleInstance_NewInstanceDetected;
|
||||
}
|
||||
|
||||
SharpTreeNode.SetImagesProvider(new WpfWindowsTreeNodeImagesProvider());
|
||||
|
||||
InitializeComponent();
|
||||
|
||||
Resources.RegisterDefaultStyles();
|
||||
|
||||
@@ -27,9 +27,9 @@ using ICSharpCode.ILSpy.Options;
|
||||
using ICSharpCode.ILSpy.Properties;
|
||||
using ICSharpCode.ILSpy.TreeNodes;
|
||||
using ICSharpCode.ILSpy.ViewModels;
|
||||
using ICSharpCode.TreeView;
|
||||
|
||||
using Microsoft.Win32;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TextView
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ using System.Collections.Generic;
|
||||
|
||||
using ICSharpCode.ILSpy.Properties;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy
|
||||
{
|
||||
|
||||
@@ -28,7 +28,8 @@ using System.Windows.Media;
|
||||
using ICSharpCode.AvalonEdit;
|
||||
using ICSharpCode.ILSpy.TextView;
|
||||
using ICSharpCode.ILSpyX.Search;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpy.Controls.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Markup;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
public class CollapsedWhenFalse : MarkupExtension, IValueConverter
|
||||
{
|
||||
@@ -20,7 +20,9 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
class EditTextBox : TextBox
|
||||
{
|
||||
@@ -22,7 +22,7 @@ using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
static class ExtensionMethods
|
||||
{
|
||||
@@ -20,7 +20,7 @@ using System.Windows;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
public class GeneralAdorner : Adorner
|
||||
{
|
||||
@@ -19,7 +19,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
public class InsertMarker : Control
|
||||
{
|
||||
@@ -20,7 +20,7 @@ using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
class LinesRenderer : FrameworkElement
|
||||
{
|
||||
@@ -19,7 +19,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
public class SharpGridView : GridView
|
||||
{
|
||||
@@ -16,7 +16,6 @@
|
||||
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
@@ -24,7 +23,9 @@ using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
public class SharpTreeNodeView : Control
|
||||
{
|
||||
@@ -28,7 +28,9 @@ using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
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)
|
||||
{
|
||||
e.Handled = true;
|
||||
container.Node.ActivateItem(e);
|
||||
container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e));
|
||||
}
|
||||
break;
|
||||
case Key.Space:
|
||||
@@ -319,7 +321,7 @@ namespace ICSharpCode.TreeView
|
||||
}
|
||||
else
|
||||
{
|
||||
container.Node.ActivateItem(e);
|
||||
container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e));
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -462,7 +464,7 @@ namespace ICSharpCode.TreeView
|
||||
if (Root != null && !ShowRoot)
|
||||
{
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
e.Handled = true;
|
||||
target.Node.InternalDrop(e, target.Index);
|
||||
target.Node.InternalDrop(new WpfWindowsDragEventArgs(e), target.Index);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -612,7 +614,7 @@ namespace ICSharpCode.TreeView
|
||||
if (node != null)
|
||||
{
|
||||
e.Effects = DragDropEffects.None;
|
||||
if (node.CanDrop(e, index))
|
||||
if (node.CanDrop(new WpfWindowsDragEventArgs(e), index))
|
||||
{
|
||||
DropTarget target = new DropTarget() {
|
||||
Item = item,
|
||||
@@ -1,6 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
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">
|
||||
|
||||
<Style x:Key="ExpandCollapseToggleStyle"
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
|
||||
using System.Windows.Automation.Peers;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
class SharpTreeViewAutomationPeer : FrameworkElementAutomationPeer
|
||||
{
|
||||
@@ -22,7 +22,9 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
public class SharpTreeViewItem : ListViewItem
|
||||
{
|
||||
@@ -103,7 +105,7 @@ namespace ICSharpCode.TreeView
|
||||
var selection = ParentTreeView.GetTopLevelSelection().ToArray();
|
||||
if (Node.CanDrag(selection))
|
||||
{
|
||||
Node.StartDrag(this, selection);
|
||||
Node.StartDrag(this, selection, new WpfWindowsDragDropManager());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -114,7 +116,7 @@ namespace ICSharpCode.TreeView
|
||||
if (wasDoubleClick)
|
||||
{
|
||||
wasDoubleClick = false;
|
||||
Node.ActivateItem(e);
|
||||
Node.ActivateItem(new WpfWindowsRoutedEventArgs(e));
|
||||
if (!e.Handled)
|
||||
{
|
||||
if (!Node.IsRoot || ParentTreeView.ShowRootExpander)
|
||||
@@ -135,7 +137,7 @@ namespace ICSharpCode.TreeView
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Middle)
|
||||
{
|
||||
Node.ActivateItemSecondary(e);
|
||||
Node.ActivateItemSecondary(new WpfWindowsRoutedEventArgs(e));
|
||||
}
|
||||
else
|
||||
{
|
||||
+3
-1
@@ -22,7 +22,9 @@ using System.Windows.Automation;
|
||||
using System.Windows.Automation.Peers;
|
||||
using System.Windows.Automation.Provider;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
class SharpTreeViewItemAutomationPeer : FrameworkElementAutomationPeer, IExpandCollapseProvider
|
||||
{
|
||||
+4
-5
@@ -22,7 +22,9 @@ using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace ICSharpCode.TreeView
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.Controls.TreeView
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom TextSearch-implementation.
|
||||
@@ -30,9 +32,6 @@ namespace ICSharpCode.TreeView
|
||||
/// </summary>
|
||||
public partial class SharpTreeViewTextSearch : DependencyObject
|
||||
{
|
||||
[LibraryImport("user32.dll")]
|
||||
internal static partial int GetDoubleClickTime();
|
||||
|
||||
static readonly DependencyPropertyKey TextSearchInstancePropertyKey = DependencyProperty.RegisterAttachedReadOnly("TextSearchInstance",
|
||||
typeof(SharpTreeViewTextSearch), typeof(SharpTreeViewTextSearch), new FrameworkPropertyMetadata(null));
|
||||
static readonly DependencyProperty TextSearchInstanceProperty = TextSearchInstancePropertyKey.DependencyProperty;
|
||||
@@ -167,7 +166,7 @@ namespace ICSharpCode.TreeView
|
||||
{
|
||||
timer.Stop();
|
||||
}
|
||||
timer.Interval = TimeSpan.FromMilliseconds(GetDoubleClickTime() * 2);
|
||||
timer.Interval = TimeSpan.FromMilliseconds(NativeMethods.GetDoubleClickTime() * 2);
|
||||
timer.Start();
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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; }
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,6 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ICSharpCode.ILSpyX\ICSharpCode.ILSpyX.csproj" />
|
||||
<ProjectReference Include="..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.csproj" />
|
||||
<ProjectReference Include="..\SharpTreeView\ICSharpCode.TreeView.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
namespace ICSharpCode.ILSpy
|
||||
{
|
||||
public class WpfWindowsTreeNodeImagesProvider : ITreeNodeImagesProvider
|
||||
{
|
||||
public object Assembly => Images.Assembly;
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,9 @@
|
||||
<Window
|
||||
x:Class="ICSharpCode.ILSpy.MainWindow"
|
||||
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:search="clr-namespace:ICSharpCode.ILSpy.Search"
|
||||
xmlns:avalondock="https://github.com/Dirkster99/AvalonDock"
|
||||
@@ -144,7 +146,7 @@
|
||||
<Style TargetType="{x:Type MenuItem}" BasedOn="{StaticResource {x:Type MenuItem}}">
|
||||
<Setter Property="Command" Value="{x:Static local:ILSpyCommands.SetTheme}" />
|
||||
<Setter Property="CommandParameter" Value="{Binding}" />
|
||||
<Setter Property="IsCheckable" Value="True" /> <!-- Required by AvalonDock's MenuItem style to show the checkmark -->
|
||||
<Setter Property="IsCheckable" Value="True" /><!-- Required by AvalonDock's MenuItem style to show the checkmark -->
|
||||
<Setter Property="IsChecked">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{x:Static toms:BinaryOperationConverter.Equality}" Mode="OneWay">
|
||||
|
||||
@@ -57,9 +57,10 @@ using ICSharpCode.ILSpy.ViewModels;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.ILSpyX.FileLoaders;
|
||||
using ICSharpCode.ILSpyX.Settings;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpy.Controls.TreeView;
|
||||
|
||||
using Microsoft.Win32;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy
|
||||
{
|
||||
|
||||
@@ -26,6 +26,9 @@ namespace ICSharpCode.ILSpy
|
||||
{
|
||||
const int S_OK = 0;
|
||||
|
||||
[LibraryImport("user32.dll")]
|
||||
internal static partial int GetDoubleClickTime();
|
||||
|
||||
[LibraryImport("dwmapi.dll")]
|
||||
internal static partial int DwmSetWindowAttribute(IntPtr hwnd, DwmWindowAttribute attr, ref int attrValue, int attrSize);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ using System.Diagnostics;
|
||||
|
||||
using ICSharpCode.ILSpy.TextView;
|
||||
using ICSharpCode.ILSpy.ViewModels;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy
|
||||
{
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Controls/SearchBoxStyle.xaml" />
|
||||
<ResourceDictionary Source="../Controls/ZoomScrollViewer.xaml" />
|
||||
<ResourceDictionary Source="../Controls/TreeView/SharpTreeView.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
|
||||
<!-- SortableGridViewColumn.
|
||||
Displays an up arrow or down arrow in the column header when the grid is sorted using that column.
|
||||
-->
|
||||
|
||||
@@ -26,7 +26,8 @@ using ICSharpCode.Decompiler.Metadata;
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.Decompiler.Util;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
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))
|
||||
return true;
|
||||
else if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
return true;
|
||||
else
|
||||
{
|
||||
e.Effects = DragDropEffects.None;
|
||||
e.Effects = XPlatDragDropEffects.None;
|
||||
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[];
|
||||
if (files == null)
|
||||
@@ -186,7 +187,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
if (bundle == null)
|
||||
return null;
|
||||
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)
|
||||
return node;
|
||||
|
||||
@@ -22,6 +22,9 @@ using System.Windows.Threading;
|
||||
using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.Decompiler.Metadata;
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
using TomsToolbox.Wpf.Controls;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
@@ -48,7 +51,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
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 {
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -35,11 +35,13 @@ using ICSharpCode.ILSpy.ViewModels;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.ILSpyX.FileLoaders;
|
||||
using ICSharpCode.ILSpyX.PdbProvider;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpy.Controls.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
using Microsoft.Win32;
|
||||
|
||||
using TypeDefinitionHandle = System.Reflection.Metadata.TypeDefinitionHandle;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
@@ -410,9 +412,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
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()
|
||||
@@ -433,9 +435,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
|
||||
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());
|
||||
return dataObject;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ using System.Linq;
|
||||
|
||||
using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
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 void ActivateItem(System.Windows.RoutedEventArgs e)
|
||||
public override void ActivateItem(IPlatformRoutedEventArgs e)
|
||||
{
|
||||
e.Handled = ActivateItem(this, type);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.Decompiler.Metadata;
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
|
||||
@@ -26,6 +26,7 @@ using ICSharpCode.ILSpyX;
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
class DerivedTypesEntryNode : ILSpyTreeNode, IMemberTreeNode
|
||||
{
|
||||
@@ -89,7 +90,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -23,14 +23,13 @@ using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Reflection.Metadata;
|
||||
using System.Reflection.Metadata.Ecma335;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.Decompiler.TypeSystem;
|
||||
using ICSharpCode.ILSpy.Options;
|
||||
using ICSharpCode.ILSpyX.Abstractions;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
@@ -77,7 +76,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ActivateItemSecondary(RoutedEventArgs e)
|
||||
public override void ActivateItemSecondary(IPlatformRoutedEventArgs e)
|
||||
{
|
||||
MainWindow.Instance.SelectNode(this, inNewTabPage: true);
|
||||
MainWindow.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)MainWindow.Instance.RefreshDecompiledView);
|
||||
@@ -93,7 +92,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
return false;
|
||||
}
|
||||
|
||||
protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
|
||||
internal protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (e.NewItems != null)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@ using System.Reflection.Metadata;
|
||||
|
||||
using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.Decompiler.Metadata;
|
||||
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
@@ -69,7 +70,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
|
||||
|
||||
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;
|
||||
if (assemblyListNode != null && containsMetadata)
|
||||
|
||||
@@ -22,7 +22,7 @@ using System.Linq;
|
||||
|
||||
using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.ILSpyX;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ using System.Windows.Threading;
|
||||
|
||||
using ICSharpCode.Decompiler;
|
||||
using ICSharpCode.ILSpy.Properties;
|
||||
using ICSharpCode.TreeView;
|
||||
using ICSharpCode.ILSpyX.TreeView;
|
||||
|
||||
namespace ICSharpCode.ILSpy.TreeNodes
|
||||
{
|
||||
|
||||
@@ -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>
|
||||
@@ -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")]
|
||||
@@ -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";
|
||||
}
|
||||
Reference in New Issue
Block a user