mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-18 17:02:10 -10:00
* ConvertEventArgs.cs * ConvertEventHandler.cs * CreateParams.cs * Cursor.cs * DateBoldEventArgs.cs * DateRangeEventArgs.cs * DateRangeEventHandler.cs * DialogResult.cs * DockStyle.cs * DragAction.cs * DragDropEffects.cs * DragEventArgs.cs * DragEventHandler.cs * DrawItemState.cs * ErrorIconAlignment.cs * FlatStyle.cs * FormBorderStyle.cs * FormStartPosition.cs * FormWindowState.cs * GiveFeedbackEventArgs.cs * GiveFeedbackEventHandler.cs * GridItem.cs svn path=/trunk/mcs/; revision=8435
178 lines
4.1 KiB
C#
178 lines
4.1 KiB
C#
//
|
|
// System.Windows.Forms.DragEventArgs
|
|
//
|
|
// Author:
|
|
// stubbed out by Richard Baumann ([email protected])
|
|
// Implemented by Richard Baumann <[email protected]>
|
|
// Dennis Hayes ([email protected])
|
|
// Gianandrea Terzi ([email protected])
|
|
//
|
|
// (C) Ximian, Inc., 2002
|
|
//
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace System.Windows.Forms {
|
|
|
|
/// <summary>
|
|
/// Provides data for the DragDrop, DragEnter, or DragOver event.
|
|
/// </summary>
|
|
[ComVisible(true)]
|
|
public class DragEventArgs : EventArgs {
|
|
|
|
#region Fields
|
|
private DragDropEffects allowedEffect;
|
|
private IDataObject data;
|
|
private DragDropEffects effect;
|
|
private int keyState;
|
|
private int x;
|
|
private int y;
|
|
#endregion
|
|
|
|
//
|
|
// --- Constructors/Destructors
|
|
//
|
|
public DragEventArgs(IDataObject data, int keyState, int x, int y, DragDropEffects allowedEffect, DragDropEffects effect) : base()
|
|
{
|
|
this.data = data;
|
|
this.keyState = keyState;
|
|
this.x = x;
|
|
this.y = y;
|
|
this.allowedEffect = allowedEffect;
|
|
this.effect = effect;
|
|
}
|
|
|
|
#region Public Properties
|
|
[ComVisible(true)]
|
|
public DragDropEffects AllowedEffect {
|
|
get {
|
|
return allowedEffect;
|
|
}
|
|
}
|
|
[ComVisible(true)]
|
|
public IDataObject Data {
|
|
get {
|
|
return data;
|
|
}
|
|
}
|
|
[ComVisible(true)]
|
|
public DragDropEffects Effect {
|
|
get {
|
|
return effect;
|
|
}
|
|
set {
|
|
effect = value;
|
|
}
|
|
}
|
|
[ComVisible(true)]
|
|
public int KeyState {
|
|
get {
|
|
return keyState;
|
|
}
|
|
}
|
|
[ComVisible(true)]
|
|
public int X {
|
|
get {
|
|
return x;
|
|
}
|
|
}
|
|
[ComVisible(true)]
|
|
public int Y {
|
|
get {
|
|
return y;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region Public Methods
|
|
|
|
/// <summary>
|
|
/// Equality Operator
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Compares two DragEventArgs objects.
|
|
/// The return value is based on the equivalence of
|
|
/// AllowedEffect, Data, Effect, KeyState, X , Y Property
|
|
/// of the two DragEventArgs.
|
|
/// </remarks>
|
|
public static bool operator == (DragEventArgs DragEventArgsA, DragEventArgs DragEventArgsB)
|
|
{
|
|
return (DragEventArgsA.AllowedEffect == DragEventArgsB.AllowedEffect) &&
|
|
(DragEventArgsA.Data == DragEventArgsB.Data) &&
|
|
(DragEventArgsA.Effect == DragEventArgsB.Effect) &&
|
|
(DragEventArgsA.KeyState == DragEventArgsB.KeyState) &&
|
|
(DragEventArgsA.X == DragEventArgsB.X) &&
|
|
(DragEventArgsA.Y == DragEventArgsB.Y);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Inequality Operator
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Compares two DragEventArgs objects.
|
|
/// The return value is based on the equivalence of
|
|
/// AllowedEffect, Data, Effect, KeyState, X , Y Property
|
|
/// of the two DragEventArgs.
|
|
/// </remarks>
|
|
public static bool operator != (DragEventArgs DragEventArgsA, DragEventArgs DragEventArgsB)
|
|
{
|
|
return (DragEventArgsA.AllowedEffect != DragEventArgsB.AllowedEffect) ||
|
|
(DragEventArgsA.Data != DragEventArgsB.Data) ||
|
|
(DragEventArgsA.Effect != DragEventArgsB.Effect) ||
|
|
(DragEventArgsA.KeyState != DragEventArgsB.KeyState) ||
|
|
(DragEventArgsA.X != DragEventArgsB.X) ||
|
|
(DragEventArgsA.Y != DragEventArgsB.Y);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Equals Method
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Checks equivalence of this
|
|
/// DragEventArgs and another
|
|
/// object.
|
|
/// </remarks>
|
|
public override bool Equals (object obj)
|
|
{
|
|
if (!(obj is DragEventArgs))return false;
|
|
return (this == (DragEventArgs) obj);
|
|
}
|
|
|
|
/// <summary>
|
|
/// GetHashCode Method
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Calculates a hashing value.
|
|
/// </remarks>
|
|
[MonoTODO]
|
|
public override int GetHashCode ()
|
|
{
|
|
//FIXME: add class specific stuff;
|
|
return base.GetHashCode();
|
|
}
|
|
|
|
/// <summary>
|
|
/// ToString Method
|
|
/// </summary>
|
|
///
|
|
/// <remarks>
|
|
/// Formats the object as a string.
|
|
/// </remarks>
|
|
[MonoTODO]
|
|
public override string ToString ()
|
|
{
|
|
//FIXME: add class specific stuff;
|
|
return base.ToString() + " DragEventArgs";
|
|
}
|
|
|
|
|
|
#endregion
|
|
|
|
}
|
|
}
|