DragAndDrop core
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using Lattice.Core.DragDrop.Models;
|
||||
|
||||
namespace Lattice.Core.DragDrop.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Аргументы события отмены перетаскивания.
|
||||
/// </summary>
|
||||
public class DragCancelledEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Информация о перетаскивании.
|
||||
/// </summary>
|
||||
public DragInfo DragInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр класса <see cref="DragCancelledEventArgs"/>.
|
||||
/// </summary>
|
||||
public DragCancelledEventArgs(DragInfo dragInfo)
|
||||
{
|
||||
DragInfo = dragInfo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Lattice.Core.DragDrop.Models;
|
||||
using Lattice.Core.Geometry;
|
||||
|
||||
namespace Lattice.Core.DragDrop.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Аргументы события завершения перетаскивания.
|
||||
/// </summary>
|
||||
public class DragCompletedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Информация о перетаскивании.
|
||||
/// </summary>
|
||||
public DragInfo DragInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Позиция завершения перетаскивания.
|
||||
/// </summary>
|
||||
public Point DropPosition { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Примененные эффекты перетаскивания.
|
||||
/// </summary>
|
||||
public Enums.DragDropEffects Effects { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр класса <see cref="DragCompletedEventArgs"/>.
|
||||
/// </summary>
|
||||
public DragCompletedEventArgs(DragInfo dragInfo, Point dropPosition, Enums.DragDropEffects effects)
|
||||
{
|
||||
DragInfo = dragInfo;
|
||||
DropPosition = dropPosition;
|
||||
Effects = effects;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace Lattice.Core.DragDrop.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Аргументы события ошибки в операции перетаскивания.
|
||||
/// </summary>
|
||||
public class DragDropErrorEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Ошибка, которая произошла.
|
||||
/// </summary>
|
||||
public Exception Exception { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Операция, во время которой произошла ошибка.
|
||||
/// </summary>
|
||||
public string Operation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Контекст операции.
|
||||
/// </summary>
|
||||
public object? Context { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр класса <see cref="DragDropErrorEventArgs"/>.
|
||||
/// </summary>
|
||||
public DragDropErrorEventArgs(Exception exception, string operation, object? context = null)
|
||||
{
|
||||
Exception = exception;
|
||||
Operation = operation;
|
||||
Context = context;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Lattice.Core.DragDrop.Models;
|
||||
using Lattice.Core.Geometry;
|
||||
|
||||
namespace Lattice.Core.DragDrop.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Аргументы события начала перетаскивания.
|
||||
/// </summary>
|
||||
public class DragStartedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Информация о перетаскивании.
|
||||
/// </summary>
|
||||
public DragInfo DragInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Начальная позиция перетаскивания.
|
||||
/// </summary>
|
||||
public Point StartPosition { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр класса <see cref="DragStartedEventArgs"/>.
|
||||
/// </summary>
|
||||
public DragStartedEventArgs(DragInfo dragInfo, Point startPosition)
|
||||
{
|
||||
DragInfo = dragInfo;
|
||||
StartPosition = startPosition;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
using Lattice.Core.DragDrop.Models;
|
||||
using Lattice.Core.Geometry;
|
||||
|
||||
namespace Lattice.Core.DragDrop.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Аргументы события обновления перетаскивания.
|
||||
/// </summary>
|
||||
public class DragUpdatedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Информация о перетаскивании.
|
||||
/// </summary>
|
||||
public DragInfo DragInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Текущая позиция перетаскивания.
|
||||
/// </summary>
|
||||
public Point Position { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр класса <see cref="DragUpdatedEventArgs"/>.
|
||||
/// </summary>
|
||||
public DragUpdatedEventArgs(DragInfo dragInfo, Point position)
|
||||
{
|
||||
DragInfo = dragInfo;
|
||||
Position = position;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using Lattice.Core.DragDrop.Models;
|
||||
using Lattice.Core.Geometry;
|
||||
|
||||
namespace Lattice.Core.DragDrop.Services;
|
||||
|
||||
/// <summary>
|
||||
/// Аргументы события изменения цели сброса.
|
||||
/// </summary>
|
||||
public class DropTargetChangedEventArgs : EventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Информация о перетаскивании.
|
||||
/// </summary>
|
||||
public DragInfo DragInfo { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Новая цель сброса.
|
||||
/// </summary>
|
||||
public Abstractions.IDropTarget Target { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Границы цели.
|
||||
/// </summary>
|
||||
public Rect TargetBounds { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Инициализирует новый экземпляр класса <see cref="DropTargetChangedEventArgs"/>.
|
||||
/// </summary>
|
||||
public DropTargetChangedEventArgs(DragInfo dragInfo, Abstractions.IDropTarget target, Rect targetBounds)
|
||||
{
|
||||
DragInfo = dragInfo;
|
||||
Target = target;
|
||||
TargetBounds = targetBounds;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user