diff --git a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj index bde8d593a7..bcea038e2e 100644 --- a/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj +++ b/ICSharpCode.ILSpyX/ICSharpCode.ILSpyX.csproj @@ -5,16 +5,16 @@ enable true nullable - + True ..\ICSharpCode.Decompiler\ICSharpCode.Decompiler.snk - + en-US False False False - + ICSharpCode.ILSpyX 8.0.0.0-noversion @@ -32,22 +32,27 @@ false Copyright 2022-$([System.DateTime]::Now.Year) AlphaSierraPapa C# Decompiler ILSpy - + true embedded true true true - + + + + + + - + - + true @@ -77,7 +82,7 @@ - + diff --git a/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs b/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs index 2ff1a3ed78..34d6f6fa16 100644 --- a/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs +++ b/ICSharpCode.ILSpyX/Properties/AssemblyInfo.cs @@ -19,7 +19,3 @@ [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")] - diff --git a/SharpTreeView/FlatListTreeNode.cs b/ICSharpCode.ILSpyX/TreeView/FlatListTreeNode.cs similarity index 99% rename from SharpTreeView/FlatListTreeNode.cs rename to ICSharpCode.ILSpyX/TreeView/FlatListTreeNode.cs index 6ae54e74e8..f63898278d 100644 --- a/SharpTreeView/FlatListTreeNode.cs +++ b/ICSharpCode.ILSpyX/TreeView/FlatListTreeNode.cs @@ -20,7 +20,9 @@ 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. diff --git a/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDataObject.cs b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDataObject.cs new file mode 100644 index 0000000000..5c2f4a1ef0 --- /dev/null +++ b/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); + } +} diff --git a/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragDrop.cs b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragDrop.cs new file mode 100644 index 0000000000..c554f4f270 --- /dev/null +++ b/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); + } +} diff --git a/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragEventArgs.cs b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformDragEventArgs.cs new file mode 100644 index 0000000000..5434802038 --- /dev/null +++ b/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; } + } +} diff --git a/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformRoutedEventArgs.cs b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformRoutedEventArgs.cs new file mode 100644 index 0000000000..7d1b8ec30a --- /dev/null +++ b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/IPlatformRoutedEventArgs.cs @@ -0,0 +1,7 @@ +namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions +{ + public interface IPlatformRoutedEventArgs + { + bool Handled { get; set; } + } +} diff --git a/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/ITreeNodeImagesProvider.cs b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/ITreeNodeImagesProvider.cs new file mode 100644 index 0000000000..acd2e85d2b --- /dev/null +++ b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/ITreeNodeImagesProvider.cs @@ -0,0 +1,7 @@ +namespace ICSharpCode.ILSpyX.TreeView.PlatformAbstractions +{ + public interface ITreeNodeImagesProvider + { + object Assembly { get; } + } +} diff --git a/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/XPlatDragDropEffects.cs b/ICSharpCode.ILSpyX/TreeView/PlatformAbstractions/XPlatDragDropEffects.cs new file mode 100644 index 0000000000..fdfd89369c --- /dev/null +++ b/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 + } +} diff --git a/SharpTreeView/SharpTreeNode.cs b/ICSharpCode.ILSpyX/TreeView/SharpTreeNode.cs similarity index 93% rename from SharpTreeView/SharpTreeNode.cs rename to ICSharpCode.ILSpyX/TreeView/SharpTreeNode.cs index bf694c765d..79686bdbad 100644 --- a/SharpTreeView/SharpTreeNode.cs +++ b/ICSharpCode.ILSpyX/TreeView/SharpTreeNode.cs @@ -22,14 +22,18 @@ 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 @@ public virtual void DeleteCore() 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 @@ public virtual bool CanDrag(SharpTreeNode[] nodes) 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 @@ internal void InternalDrop(DragEventArgs e, int 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()"); } @@ -703,14 +708,14 @@ public void RaisePropertyChanged(string name) /// /// Gets called when the item is double-clicked. /// - public virtual void ActivateItem(RoutedEventArgs e) + public virtual void ActivateItem(IPlatformRoutedEventArgs e) { } /// /// Gets called when the item is clicked with the middle mouse button. /// - public virtual void ActivateItemSecondary(RoutedEventArgs e) + public virtual void ActivateItemSecondary(IPlatformRoutedEventArgs e) { } diff --git a/SharpTreeView/SharpTreeNodeCollection.cs b/ICSharpCode.ILSpyX/TreeView/SharpTreeNodeCollection.cs similarity index 99% rename from SharpTreeView/SharpTreeNodeCollection.cs rename to ICSharpCode.ILSpyX/TreeView/SharpTreeNodeCollection.cs index f21d466866..8b69a9553d 100644 --- a/SharpTreeView/SharpTreeNodeCollection.cs +++ b/ICSharpCode.ILSpyX/TreeView/SharpTreeNodeCollection.cs @@ -22,7 +22,9 @@ using System.Diagnostics; using System.Linq; -namespace ICSharpCode.TreeView +#nullable disable + +namespace ICSharpCode.ILSpyX.TreeView { /// /// Collection that validates that inserted nodes do not have another parent. diff --git a/SharpTreeView/TreeFlattener.cs b/ICSharpCode.ILSpyX/TreeView/TreeFlattener.cs similarity index 98% rename from SharpTreeView/TreeFlattener.cs rename to ICSharpCode.ILSpyX/TreeView/TreeFlattener.cs index 39175f470c..46cc5cafd9 100644 --- a/SharpTreeView/TreeFlattener.cs +++ b/ICSharpCode.ILSpyX/TreeView/TreeFlattener.cs @@ -22,7 +22,9 @@ using System.Collections.Specialized; using System.Diagnostics; -namespace ICSharpCode.TreeView +#nullable disable + +namespace ICSharpCode.ILSpyX.TreeView { sealed class TreeFlattener : IList, INotifyCollectionChanged { diff --git a/SharpTreeView/TreeTraversal.cs b/ICSharpCode.ILSpyX/TreeView/TreeTraversal.cs similarity index 98% rename from SharpTreeView/TreeTraversal.cs rename to ICSharpCode.ILSpyX/TreeView/TreeTraversal.cs index ef196a61df..25034616d7 100644 --- a/SharpTreeView/TreeTraversal.cs +++ b/ICSharpCode.ILSpyX/TreeView/TreeTraversal.cs @@ -19,7 +19,7 @@ using System; using System.Collections.Generic; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpyX.TreeView { /// /// Static helper methods for traversing trees. diff --git a/ILSpy.Wpf.slnf b/ILSpy.Wpf.slnf index 831214ce7f..4e5db53cc3 100644 --- a/ILSpy.Wpf.slnf +++ b/ILSpy.Wpf.slnf @@ -12,7 +12,6 @@ "ILSpy.ReadyToRun\\ILSpy.ReadyToRun.csproj", "ILSpy.Tests\\ILSpy.Tests.csproj", "ILSpy\\ILSpy.csproj", - "SharpTreeView\\ICSharpCode.TreeView.csproj", "TestPlugin\\TestPlugin.csproj" ] } diff --git a/ILSpy.sln b/ILSpy.sln index 604606ee37..5d4e13a931 100644 --- a/ILSpy.sln +++ b/ILSpy.sln @@ -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 diff --git a/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs b/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs index 38d94c1c59..213624ee1a 100644 --- a/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs +++ b/ILSpy/Analyzers/AnalyzerEntityTreeNode.cs @@ -22,7 +22,8 @@ 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 @@ public abstract class AnalyzerEntityTreeNode : AnalyzerTreeNode, IMemberTreeNode { 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) diff --git a/ILSpy/Analyzers/AnalyzerTreeNode.cs b/ILSpy/Analyzers/AnalyzerTreeNode.cs index 5f9b396503..e2946c3e06 100644 --- a/ILSpy/Analyzers/AnalyzerTreeNode.cs +++ b/ILSpy/Analyzers/AnalyzerTreeNode.cs @@ -21,7 +21,7 @@ using System.Linq; using ICSharpCode.ILSpyX; -using ICSharpCode.TreeView; +using ICSharpCode.ILSpyX.TreeView; namespace ICSharpCode.ILSpy.Analyzers { @@ -56,7 +56,7 @@ public override void Delete() DeleteCore(); } - protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e) + internal protected override void OnChildrenChanged(NotifyCollectionChangedEventArgs e) { if (e.NewItems != null) { diff --git a/ILSpy/Analyzers/AnalyzerTreeView.cs b/ILSpy/Analyzers/AnalyzerTreeView.cs index 500f40f793..4e40239ea8 100644 --- a/ILSpy/Analyzers/AnalyzerTreeView.cs +++ b/ILSpy/Analyzers/AnalyzerTreeView.cs @@ -27,7 +27,8 @@ 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 { diff --git a/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs b/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs index 9a8558e4cc..e7f83f6385 100644 --- a/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs +++ b/ILSpy/Analyzers/TreeNodes/AnalyzedModuleTreeNode.cs @@ -22,6 +22,7 @@ using ICSharpCode.Decompiler.TypeSystem; using ICSharpCode.ILSpyX.Analyzers; +using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; namespace ICSharpCode.ILSpy.Analyzers.TreeNodes { @@ -52,7 +53,7 @@ protected override void LoadChildren() } } - public override void ActivateItem(RoutedEventArgs e) + public override void ActivateItem(IPlatformRoutedEventArgs e) { e.Handled = true; if (analyzedModule.MetadataFile == null) diff --git a/ILSpy/App.xaml.cs b/ILSpy/App.xaml.cs index 26dc4d1a8a..77722c3ae8 100644 --- a/ILSpy/App.xaml.cs +++ b/ILSpy/App.xaml.cs @@ -40,6 +40,7 @@ using Microsoft.VisualStudio.Composition; using TomsToolbox.Wpf.Styles; +using ICSharpCode.ILSpyX.TreeView; namespace ICSharpCode.ILSpy { @@ -75,6 +76,8 @@ public App() SingleInstance.NewInstanceDetected += SingleInstance_NewInstanceDetected; } + SharpTreeNode.SetImagesProvider(new WpfWindowsTreeNodeImagesProvider()); + InitializeComponent(); Resources.RegisterDefaultStyles(); diff --git a/ILSpy/Commands/SaveCodeContextMenuEntry.cs b/ILSpy/Commands/SaveCodeContextMenuEntry.cs index 13b06a3b34..5ce79ee102 100644 --- a/ILSpy/Commands/SaveCodeContextMenuEntry.cs +++ b/ILSpy/Commands/SaveCodeContextMenuEntry.cs @@ -27,9 +27,9 @@ 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 { diff --git a/ILSpy/Commands/SortAssemblyListCommand.cs b/ILSpy/Commands/SortAssemblyListCommand.cs index 29cd8ae055..110a60b8a9 100644 --- a/ILSpy/Commands/SortAssemblyListCommand.cs +++ b/ILSpy/Commands/SortAssemblyListCommand.cs @@ -21,7 +21,7 @@ using ICSharpCode.ILSpy.Properties; using ICSharpCode.ILSpyX; -using ICSharpCode.TreeView; +using ICSharpCode.ILSpyX.TreeView; namespace ICSharpCode.ILSpy { diff --git a/ILSpy/ContextMenuEntry.cs b/ILSpy/ContextMenuEntry.cs index 73aa3ba735..9ce4416a2a 100644 --- a/ILSpy/ContextMenuEntry.cs +++ b/ILSpy/ContextMenuEntry.cs @@ -28,7 +28,8 @@ 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 { diff --git a/SharpTreeView/Converters.cs b/ILSpy/Controls/TreeView/Converters.cs similarity index 97% rename from SharpTreeView/Converters.cs rename to ILSpy/Controls/TreeView/Converters.cs index 87c31ee37f..401d9026c3 100644 --- a/SharpTreeView/Converters.cs +++ b/ILSpy/Controls/TreeView/Converters.cs @@ -22,7 +22,7 @@ using System.Windows.Data; using System.Windows.Markup; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpy.Controls.TreeView { public class CollapsedWhenFalse : MarkupExtension, IValueConverter { diff --git a/SharpTreeView/EditTextBox.cs b/ILSpy/Controls/TreeView/EditTextBox.cs similarity index 96% rename from SharpTreeView/EditTextBox.cs rename to ILSpy/Controls/TreeView/EditTextBox.cs index 965c035c8e..0f37b8b56a 100644 --- a/SharpTreeView/EditTextBox.cs +++ b/ILSpy/Controls/TreeView/EditTextBox.cs @@ -20,7 +20,9 @@ using System.Windows.Controls; using System.Windows.Input; -namespace ICSharpCode.TreeView +using ICSharpCode.ILSpyX.TreeView; + +namespace ICSharpCode.ILSpy.Controls.TreeView { class EditTextBox : TextBox { diff --git a/SharpTreeView/ExtensionMethods.cs b/ILSpy/Controls/TreeView/ExtensionMethods.cs similarity index 97% rename from SharpTreeView/ExtensionMethods.cs rename to ILSpy/Controls/TreeView/ExtensionMethods.cs index 6ae130d25d..410169272b 100644 --- a/SharpTreeView/ExtensionMethods.cs +++ b/ILSpy/Controls/TreeView/ExtensionMethods.cs @@ -22,7 +22,7 @@ using System.Windows; using System.Windows.Media; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpy.Controls.TreeView { static class ExtensionMethods { diff --git a/SharpTreeView/GeneralAdorner.cs b/ILSpy/Controls/TreeView/GeneralAdorner.cs similarity index 97% rename from SharpTreeView/GeneralAdorner.cs rename to ILSpy/Controls/TreeView/GeneralAdorner.cs index e1188bf419..4e75b6352f 100644 --- a/SharpTreeView/GeneralAdorner.cs +++ b/ILSpy/Controls/TreeView/GeneralAdorner.cs @@ -20,7 +20,7 @@ using System.Windows.Documents; using System.Windows.Media; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpy.Controls.TreeView { public class GeneralAdorner : Adorner { diff --git a/SharpTreeView/InsertMarker.cs b/ILSpy/Controls/TreeView/InsertMarker.cs similarity index 96% rename from SharpTreeView/InsertMarker.cs rename to ILSpy/Controls/TreeView/InsertMarker.cs index 7bbc6bb273..11ecde55c9 100644 --- a/SharpTreeView/InsertMarker.cs +++ b/ILSpy/Controls/TreeView/InsertMarker.cs @@ -19,7 +19,7 @@ using System.Windows; using System.Windows.Controls; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpy.Controls.TreeView { public class InsertMarker : Control { diff --git a/SharpTreeView/LinesRenderer.cs b/ILSpy/Controls/TreeView/LinesRenderer.cs similarity index 98% rename from SharpTreeView/LinesRenderer.cs rename to ILSpy/Controls/TreeView/LinesRenderer.cs index 66aac78f80..ca62d3b313 100644 --- a/SharpTreeView/LinesRenderer.cs +++ b/ILSpy/Controls/TreeView/LinesRenderer.cs @@ -20,7 +20,7 @@ using System.Windows; using System.Windows.Media; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpy.Controls.TreeView { class LinesRenderer : FrameworkElement { diff --git a/SharpTreeView/SharpGridView.cs b/ILSpy/Controls/TreeView/SharpGridView.cs similarity index 97% rename from SharpTreeView/SharpGridView.cs rename to ILSpy/Controls/TreeView/SharpGridView.cs index 9487d936db..c48f0d3a1a 100644 --- a/SharpTreeView/SharpGridView.cs +++ b/ILSpy/Controls/TreeView/SharpGridView.cs @@ -19,7 +19,7 @@ using System.Windows; using System.Windows.Controls; -namespace ICSharpCode.TreeView +namespace ICSharpCode.ILSpy.Controls.TreeView { public class SharpGridView : GridView { diff --git a/SharpTreeView/SharpTreeNodeView.cs b/ILSpy/Controls/TreeView/SharpTreeNodeView.cs similarity index 98% rename from SharpTreeView/SharpTreeNodeView.cs rename to ILSpy/Controls/TreeView/SharpTreeNodeView.cs index 30c8c13a12..a7cca88386 100644 --- a/SharpTreeView/SharpTreeNodeView.cs +++ b/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 // DEALINGS IN THE SOFTWARE. -using System; using System.ComponentModel; using System.Diagnostics; using System.Windows; @@ -24,7 +23,9 @@ 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 { diff --git a/SharpTreeView/SharpTreeView.cs b/ILSpy/Controls/TreeView/SharpTreeView.cs similarity index 97% rename from SharpTreeView/SharpTreeView.cs rename to ILSpy/Controls/TreeView/SharpTreeView.cs index d4de0673da..3d4e3e7e60 100644 --- a/SharpTreeView/SharpTreeView.cs +++ b/ILSpy/Controls/TreeView/SharpTreeView.cs @@ -28,7 +28,9 @@ 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 @@ protected override void OnKeyDown(KeyEventArgs e) 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 @@ protected override void OnKeyDown(KeyEventArgs e) } else { - container.Node.ActivateItem(e); + container.Node.ActivateItem(new WpfWindowsRoutedEventArgs(e)); } } break; @@ -462,7 +464,7 @@ protected override void OnDragOver(DragEventArgs e) 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 @@ protected override void OnDrop(DragEventArgs e) 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 @@ internal void HandleDrop(SharpTreeViewItem item, DragEventArgs e) 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 @@ void TryAddDropTarget(List targets, SharpTreeViewItem item, DropPlac 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, diff --git a/SharpTreeView/Themes/Generic.xaml b/ILSpy/Controls/TreeView/SharpTreeView.xaml similarity index 99% rename from SharpTreeView/Themes/Generic.xaml rename to ILSpy/Controls/TreeView/SharpTreeView.xaml index 5d3109b351..6e87b9e677 100644 --- a/SharpTreeView/Themes/Generic.xaml +++ b/ILSpy/Controls/TreeView/SharpTreeView.xaml @@ -1,6 +1,6 @@