Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / WinForms / Managed / System / WinForms / DropSource.cs / 1 / DropSource.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms
{
using System;
///
internal class DropSource : UnsafeNativeMethods.IOleDropSource {
private const int DragDropSDrop = 0x00040100;
private const int DragDropSCancel = 0x00040101;
private const int DragDropSUseDefaultCursors = 0x00040102;
private ISupportOleDropSource peer;
public DropSource(ISupportOleDropSource peer ) {
if (peer == null)
throw new ArgumentNullException("peer");
this.peer = peer;
}
public int OleQueryContinueDrag(int fEscapePressed, int grfKeyState) {
QueryContinueDragEventArgs qcdevent = null;
bool escapePressed = (fEscapePressed != 0);
DragAction action = DragAction.Continue;
if (escapePressed) {
action = DragAction.Cancel;
}
else if ((grfKeyState & NativeMethods.MK_LBUTTON) == 0
&& (grfKeyState & NativeMethods.MK_RBUTTON) == 0
&& (grfKeyState & NativeMethods.MK_MBUTTON) == 0) {
action = DragAction.Drop;
}
qcdevent = new QueryContinueDragEventArgs(grfKeyState,escapePressed, action);
peer.OnQueryContinueDrag(qcdevent);
int hr = 0;
switch (qcdevent.Action) {
case DragAction.Drop:
hr = DragDropSDrop;
break;
case DragAction.Cancel:
hr = DragDropSCancel;
break;
}
return hr;
}
public int OleGiveFeedback(int dwEffect) {
GiveFeedbackEventArgs gfbevent = new GiveFeedbackEventArgs((DragDropEffects) dwEffect, true);
peer.OnGiveFeedback(gfbevent);
if (gfbevent.UseDefaultCursors) {
return DragDropSUseDefaultCursors;
}
return 0;
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Windows.Forms
{
using System;
///
internal class DropSource : UnsafeNativeMethods.IOleDropSource {
private const int DragDropSDrop = 0x00040100;
private const int DragDropSCancel = 0x00040101;
private const int DragDropSUseDefaultCursors = 0x00040102;
private ISupportOleDropSource peer;
public DropSource(ISupportOleDropSource peer ) {
if (peer == null)
throw new ArgumentNullException("peer");
this.peer = peer;
}
public int OleQueryContinueDrag(int fEscapePressed, int grfKeyState) {
QueryContinueDragEventArgs qcdevent = null;
bool escapePressed = (fEscapePressed != 0);
DragAction action = DragAction.Continue;
if (escapePressed) {
action = DragAction.Cancel;
}
else if ((grfKeyState & NativeMethods.MK_LBUTTON) == 0
&& (grfKeyState & NativeMethods.MK_RBUTTON) == 0
&& (grfKeyState & NativeMethods.MK_MBUTTON) == 0) {
action = DragAction.Drop;
}
qcdevent = new QueryContinueDragEventArgs(grfKeyState,escapePressed, action);
peer.OnQueryContinueDrag(qcdevent);
int hr = 0;
switch (qcdevent.Action) {
case DragAction.Drop:
hr = DragDropSDrop;
break;
case DragAction.Cancel:
hr = DragDropSCancel;
break;
}
return hr;
}
public int OleGiveFeedback(int dwEffect) {
GiveFeedbackEventArgs gfbevent = new GiveFeedbackEventArgs((DragDropEffects) dwEffect, true);
peer.OnGiveFeedback(gfbevent);
if (gfbevent.UseDefaultCursors) {
return DragDropSUseDefaultCursors;
}
return 0;
}
}
}
// 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
- LogReservationCollection.cs
- SystemKeyConverter.cs
- Documentation.cs
- EventLogEntryCollection.cs
- StickyNoteHelper.cs
- FloatUtil.cs
- HtmlImage.cs
- DataGridViewCellStyle.cs
- BitmapCache.cs
- SqlNotificationEventArgs.cs
- BidPrivateBase.cs
- CharEnumerator.cs
- JsonGlobals.cs
- SecurityAttributeGenerationHelper.cs
- CursorConverter.cs
- EncodingInfo.cs
- IMembershipProvider.cs
- XsltContext.cs
- CryptoApi.cs
- ExecutorLocksHeldException.cs
- SpeechEvent.cs
- BindingSource.cs
- TrackingValidationObjectDictionary.cs
- XDeferredAxisSource.cs
- HitTestParameters3D.cs
- BevelBitmapEffect.cs
- smtpconnection.cs
- BufferedStream.cs
- RelationshipFixer.cs
- XmlElementAttributes.cs
- MLangCodePageEncoding.cs
- LinkDescriptor.cs
- SymbolDocumentInfo.cs
- AssertSection.cs
- CodeDomLoader.cs
- SystemNetHelpers.cs
- ClientSettingsSection.cs
- AnnotationHighlightLayer.cs
- ListenerSingletonConnectionReader.cs
- WebPartConnection.cs
- QilFactory.cs
- SafeFileMappingHandle.cs
- RequestBringIntoViewEventArgs.cs
- DbXmlEnabledProviderManifest.cs
- RelationshipManager.cs
- WinFormsSpinner.cs
- BaseValidatorDesigner.cs
- PerformanceCounterLib.cs
- PeerCredential.cs
- XmlRootAttribute.cs
- DataSetUtil.cs
- smtpconnection.cs
- FloaterParaClient.cs
- DataGridViewColumnHeaderCell.cs
- EndPoint.cs
- SecurityKeyType.cs
- MatrixAnimationUsingPath.cs
- ClientConvert.cs
- ArrayElementGridEntry.cs
- DynamicResourceExtensionConverter.cs
- ClientRolePrincipal.cs
- ComponentDispatcher.cs
- AdPostCacheSubstitution.cs
- X509SecurityToken.cs
- OracleEncoding.cs
- Semaphore.cs
- QilInvokeEarlyBound.cs
- NonParentingControl.cs
- MenuDesigner.cs
- GenericEnumConverter.cs
- WasEndpointConfigContainer.cs
- DataTablePropertyDescriptor.cs
- StandardCommands.cs
- XmlBaseReader.cs
- HandlerMappingMemo.cs
- CatalogPart.cs
- DefaultValueAttribute.cs
- DurableInstanceContextProvider.cs
- DbConnectionPool.cs
- SpellerHighlightLayer.cs
- PropertyBuilder.cs
- TextViewBase.cs
- ImageMetadata.cs
- mansign.cs
- Brushes.cs
- ColorAnimation.cs
- CellParaClient.cs
- FontFamily.cs
- ProfileProvider.cs
- DragCompletedEventArgs.cs
- FileDetails.cs
- WorkflowInstanceExtensionCollection.cs
- LayoutTable.cs
- PointLightBase.cs
- ProfileSettingsCollection.cs
- ApplicationBuildProvider.cs
- MaskDescriptor.cs
- RangeValidator.cs
- Baml2006ReaderFrame.cs
- ToolStripPanelRow.cs