Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DragEvent.cs / 1305376 / DragEvent.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
/*
*/
namespace System.Windows.Forms {
using System.Diagnostics;
using System;
using System.Drawing;
using System.Windows.Forms;
using System.ComponentModel;
using Microsoft.Win32;
///
///
///
/// Provides data for the , , or event.
///
///
[System.Runtime.InteropServices.ComVisible(true)]
public class DragEventArgs : EventArgs {
///
///
/// The data associated with this event.
///
private readonly IDataObject data;
///
///
/// The current state of the shift, ctrl, and alt keys.
///
private readonly int keyState;
///
///
/// The mouse x location.
///
private readonly int x;
///
///
/// The mouse y location.
///
private readonly int y;
///
///
/// The effect that should be applied to the mouse cursor.
///
private readonly DragDropEffects allowedEffect;
///
///
///
/// Initializes a new instance of the
/// class.
///
///
///
private DragDropEffects effect;
///
///
///
/// Initializes a new instance of the class.
///
///
public DragEventArgs(IDataObject data, int keyState, int x, int y, DragDropEffects allowedEffect, DragDropEffects effect) {
this.data = data;
this.keyState = keyState;
this.x = x;
this.y = y;
this.allowedEffect = allowedEffect;
this.effect = effect;
}
///
///
///
/// The
/// that contains the data associated with this event.
///
///
public IDataObject Data {
get {
return data;
}
}
///
///
///
/// Gets
/// the current state of the SHIFT, CTRL, and ALT keys.
///
///
///
public int KeyState {
get {
return keyState;
}
}
///
///
///
/// Gets the
/// x-coordinate
/// of the mouse pointer.
///
///
public int X {
get {
return x;
}
}
///
///
///
/// Gets
/// the y-coordinate
/// of the mouse pointer.
///
///
public int Y {
get {
return y;
}
}
///
///
///
/// Gets which drag-and-drop operations are allowed by the
/// originator (or source) of the drag event.
///
///
public DragDropEffects AllowedEffect {
get {
return allowedEffect;
}
}
///
///
///
/// Gets or sets which drag-and-drop operations are allowed by the target of the drag event.
///
///
public DragDropEffects Effect {
get {
return effect;
}
set {
effect = value;
}
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DrawingGroup.cs
- DependencyPropertyKind.cs
- StringOutput.cs
- StylusPoint.cs
- DateTimeConstantAttribute.cs
- MenuStrip.cs
- SqlPersonalizationProvider.cs
- BitmapSizeOptions.cs
- OletxDependentTransaction.cs
- ColorAnimationBase.cs
- PkcsUtils.cs
- WeakReferenceEnumerator.cs
- BaseParser.cs
- CodeNamespaceImport.cs
- DesignTableCollection.cs
- HttpListenerException.cs
- MultiBinding.cs
- GlobalizationSection.cs
- XmlMapping.cs
- GraphicsContext.cs
- SeparatorAutomationPeer.cs
- LicenseContext.cs
- OdbcConnectionString.cs
- BoundField.cs
- DataGridColumnHeadersPresenterAutomationPeer.cs
- AnimationException.cs
- panel.cs
- DeflateEmulationStream.cs
- ToolboxItemAttribute.cs
- FlagPanel.cs
- XmlSchemaAnnotation.cs
- WsdlServiceChannelBuilder.cs
- SchemaCollectionPreprocessor.cs
- KoreanCalendar.cs
- RevocationPoint.cs
- MinimizableAttributeTypeConverter.cs
- BoundsDrawingContextWalker.cs
- HtmlTernaryTree.cs
- SamlConditions.cs
- OLEDB_Enum.cs
- ToolStripComboBox.cs
- SchemaCollectionPreprocessor.cs
- XmlSchemaAttributeGroupRef.cs
- BufferModesCollection.cs
- PolicyException.cs
- ExitEventArgs.cs
- BuildDependencySet.cs
- ChangeBlockUndoRecord.cs
- ViewLoader.cs
- TypeConstant.cs
- VirtualPathUtility.cs
- PbrsForward.cs
- InvalidCastException.cs
- ContainerControlDesigner.cs
- ExpressionBindingCollection.cs
- HuffCodec.cs
- ThreadExceptionEvent.cs
- ServiceDescriptionImporter.cs
- SafeRightsManagementEnvironmentHandle.cs
- XsltInput.cs
- TaskForm.cs
- Package.cs
- GestureRecognitionResult.cs
- BoundsDrawingContextWalker.cs
- FolderBrowserDialog.cs
- PropertyPathConverter.cs
- ShaderRenderModeValidation.cs
- RecognizedPhrase.cs
- ValueQuery.cs
- ToolStripContainerActionList.cs
- XPathAncestorIterator.cs
- AddInPipelineAttributes.cs
- followingsibling.cs
- Vector3DIndependentAnimationStorage.cs
- ServicePoint.cs
- SourceCollection.cs
- Padding.cs
- InputReport.cs
- SafeMarshalContext.cs
- HtmlInputReset.cs
- MissingMethodException.cs
- OleDbParameterCollection.cs
- SQLInt64Storage.cs
- EventSetterHandlerConverter.cs
- OutOfMemoryException.cs
- MexHttpBindingElement.cs
- VerticalAlignConverter.cs
- MergeFilterQuery.cs
- FileNameEditor.cs
- ValueUtilsSmi.cs
- ComplexLine.cs
- DataMemberFieldConverter.cs
- Configuration.cs
- NavigationWindowAutomationPeer.cs
- CacheVirtualItemsEvent.cs
- SqlNode.cs
- Point3DCollectionValueSerializer.cs
- DesignOnlyAttribute.cs
- PipeException.cs
- StrokeCollection.cs