mirror of https://github.com/icsharpcode/ILSpy.git
21 changed files with 195 additions and 38 deletions
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions |
||||
{ |
||||
public interface IPlatformDataObject |
||||
{ |
||||
bool GetDataPresent(string format); |
||||
object GetData(string format); |
||||
|
||||
void SetData(string format, object data); |
||||
} |
||||
} |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions |
||||
{ |
||||
public interface IPlatformDragDrop |
||||
{ |
||||
XPlatDragDropEffects DoDragDrop(object dragSource, object data, XPlatDragDropEffects allowedEffects); |
||||
} |
||||
} |
@ -0,0 +1,8 @@
@@ -0,0 +1,8 @@
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions |
||||
{ |
||||
public interface IPlatformDragEventArgs |
||||
{ |
||||
XPlatDragDropEffects Effects { get; set; } |
||||
IPlatformDataObject Data { get; } |
||||
} |
||||
} |
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions |
||||
{ |
||||
public interface IPlatformRoutedEventArgs |
||||
{ |
||||
bool Handled { get; set; } |
||||
} |
||||
} |
@ -0,0 +1,29 @@
@@ -0,0 +1,29 @@
|
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions.WpfWindows |
||||
{ |
||||
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,12 @@
@@ -0,0 +1,12 @@
|
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions.WpfWindows |
||||
{ |
||||
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,18 @@
@@ -0,0 +1,18 @@
|
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions.WpfWindows |
||||
{ |
||||
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,16 @@
@@ -0,0 +1,16 @@
|
||||
using System.Windows; |
||||
|
||||
namespace ICSharpCode.TreeView.PlatformAbstractions.WpfWindows |
||||
{ |
||||
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,36 @@
@@ -0,0 +1,36 @@
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.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 |
||||
} |
||||
} |
Loading…
Reference in new issue