mirror of https://github.com/icsharpcode/ILSpy.git
Browse Source
* 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 NativeMethodspull/3245/head
61 changed files with 308 additions and 240 deletions
@ -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 |
||||||
|
} |
||||||
|
} |
@ -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" |
@ -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; } |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
using ICSharpCode.ILSpyX.TreeView.PlatformAbstractions; |
||||||
|
|
||||||
|
namespace ICSharpCode.ILSpy |
||||||
|
{ |
||||||
|
public class WpfWindowsTreeNodeImagesProvider : ITreeNodeImagesProvider |
||||||
|
{ |
||||||
|
public object Assembly => Images.Assembly; |
||||||
|
} |
||||||
|
} |
@ -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"; |
|
||||||
} |
|
Loading…
Reference in new issue