Add project files.
This commit is contained in:
38
Nodify/Connectors/Events/ConnectorEventArgs.cs
Normal file
38
Nodify/Connectors/Events/ConnectorEventArgs.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace Nodify.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the method that will handle <see cref="Connector"/> related routed events.
|
||||
/// </summary>
|
||||
/// <param name="sender">The object where the event handler is attached.</param>
|
||||
/// <param name="e">The event data.</param>
|
||||
public delegate void ConnectorEventHandler(object sender, ConnectorEventArgs e);
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="Nodify.Connector"/> related routed events.
|
||||
/// </summary>
|
||||
public class ConnectorEventArgs : RoutedEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConnectorEventArgs"/> class using the specified <see cref="Connector"/>.
|
||||
/// </summary>
|
||||
/// <param name="connector">The <see cref="FrameworkElement.DataContext"/> of a related <see cref="Nodify.Connector"/>.</param>
|
||||
public ConnectorEventArgs(object connector)
|
||||
=> Connector = connector;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Nodify.Connector.Anchor"/> of the <see cref="Nodify.Connector"/> associated with this event.
|
||||
/// </summary>
|
||||
public Point Anchor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="FrameworkElement.DataContext"/> of the <see cref="Nodify.Connector"/> associated with this event.
|
||||
/// </summary>
|
||||
public object Connector { get; }
|
||||
|
||||
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
|
||||
=> ((ConnectorEventHandler)genericHandler)(genericTarget, this);
|
||||
}
|
||||
}
|
||||
58
Nodify/Connectors/Events/PendingConnectionEventArgs.cs
Normal file
58
Nodify/Connectors/Events/PendingConnectionEventArgs.cs
Normal file
@@ -0,0 +1,58 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
|
||||
namespace Nodify.Events
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents the method that will handle <see cref="PendingConnection"/> related routed events.
|
||||
/// </summary>
|
||||
/// <param name="sender">The object where the event handler is attached.</param>
|
||||
/// <param name="e">The event data.</param>
|
||||
public delegate void PendingConnectionEventHandler(object sender, PendingConnectionEventArgs e);
|
||||
|
||||
/// <summary>
|
||||
/// Provides data for <see cref="PendingConnection"/> related routed events.
|
||||
/// </summary>
|
||||
public class PendingConnectionEventArgs : RoutedEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PendingConnectionEventArgs"/> class using the specified <see cref="SourceConnector"/>.
|
||||
/// </summary>
|
||||
/// <param name="sourceConnector">The <see cref="FrameworkElement.DataContext"/> of a related <see cref="Connector"/>.</param>
|
||||
public PendingConnectionEventArgs(object sourceConnector)
|
||||
=> SourceConnector = sourceConnector;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="Connector.Anchor"/> of the <see cref="Connector"/> that raised this event.
|
||||
/// </summary>
|
||||
public Point Anchor { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the <see cref="FrameworkElement.DataContext"/> of the <see cref="Connector"/> that started this <see cref="PendingConnection"/>.
|
||||
/// </summary>
|
||||
public object SourceConnector { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the <see cref="FrameworkElement.DataContext"/> of the target <see cref="Connector"/> when the <see cref="PendingConnection"/> is completed.
|
||||
/// </summary>
|
||||
public object? TargetConnector { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the distance from the <see cref="SourceConnector"/> in the X axis.
|
||||
/// </summary>
|
||||
public double OffsetX { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the distance from the <see cref="SourceConnector"/> in the Y axis.
|
||||
/// </summary>
|
||||
public double OffsetY { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value that indicates whether this <see cref="PendingConnection"/> was cancelled.
|
||||
/// </summary>
|
||||
public bool Canceled { get; set; }
|
||||
|
||||
protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
|
||||
=> ((PendingConnectionEventHandler)genericHandler)(genericTarget, this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user