Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / WinForms / Managed / System / WinForms / DragEvent.cs / 1 / 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.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewColumnEventArgs.cs
- BinaryObjectInfo.cs
- AxHostDesigner.cs
- ProbeMatchesCD1.cs
- ValueQuery.cs
- SchemaElementDecl.cs
- Messages.cs
- DynamicField.cs
- SoapFormatExtensions.cs
- SymbolEqualComparer.cs
- Environment.cs
- SequenceNumber.cs
- InputProviderSite.cs
- Directory.cs
- BadImageFormatException.cs
- MenuAutomationPeer.cs
- SimpleType.cs
- PageFunction.cs
- DesignerInterfaces.cs
- _IPv6Address.cs
- DetailsViewRowCollection.cs
- RegistryHandle.cs
- MulticastOption.cs
- Int32Rect.cs
- IndexerNameAttribute.cs
- Propagator.ExtentPlaceholderCreator.cs
- HttpStreams.cs
- List.cs
- BuiltInExpr.cs
- PageClientProxyGenerator.cs
- SqlConnectionPoolGroupProviderInfo.cs
- DataSourceConverter.cs
- TreeViewHitTestInfo.cs
- DataGridViewButtonColumn.cs
- ScriptResourceHandler.cs
- ConfigUtil.cs
- ConfigurationPermission.cs
- QilNode.cs
- ExecutionPropertyManager.cs
- SqlSelectStatement.cs
- ThreadStateException.cs
- ReflectionPermission.cs
- RegisteredDisposeScript.cs
- AttributeQuery.cs
- WebSysDisplayNameAttribute.cs
- FillErrorEventArgs.cs
- InternalCache.cs
- DrawingImage.cs
- InternalSafeNativeMethods.cs
- DiscoveryDocumentSearchPattern.cs
- SettingsSavedEventArgs.cs
- FixUpCollection.cs
- ExpressionVisitorHelpers.cs
- GridViewEditEventArgs.cs
- _FtpDataStream.cs
- MethodBody.cs
- DataSourceSelectArguments.cs
- RegisteredArrayDeclaration.cs
- SubMenuStyleCollection.cs
- DbDataAdapter.cs
- QilDataSource.cs
- DrawingAttributesDefaultValueFactory.cs
- DataControlField.cs
- ActivityTrace.cs
- ParameterToken.cs
- PropertyCollection.cs
- DebugTrace.cs
- ProgressBarHighlightConverter.cs
- WindowsTitleBar.cs
- DataRelationPropertyDescriptor.cs
- RegionIterator.cs
- XPathNode.cs
- DeviceFiltersSection.cs
- DesignRelation.cs
- HwndAppCommandInputProvider.cs
- Evaluator.cs
- ResourceDescriptionAttribute.cs
- Event.cs
- SqlClientMetaDataCollectionNames.cs
- BamlLocalizableResource.cs
- DbConnectionPool.cs
- DBCommand.cs
- WrappedKeySecurityToken.cs
- UserControlParser.cs
- SignatureGenerator.cs
- DataStorage.cs
- TextBounds.cs
- DataGridSortCommandEventArgs.cs
- CodeNamespaceImport.cs
- Hash.cs
- PublishLicense.cs
- RuleElement.cs
- GetPageCompletedEventArgs.cs
- ISSmlParser.cs
- WrapperSecurityCommunicationObject.cs
- LogAppendAsyncResult.cs
- CodeDelegateInvokeExpression.cs
- VisualTarget.cs
- Encoder.cs
- MarginCollapsingState.cs