Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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
- MergeEnumerator.cs
- KerberosReceiverSecurityToken.cs
- TextOnlyOutput.cs
- PropertyRef.cs
- BodyWriter.cs
- EntityDataSourceWrapperCollection.cs
- EntityConnection.cs
- SqlNotificationEventArgs.cs
- AdvancedBindingEditor.cs
- TraversalRequest.cs
- TypeLibConverter.cs
- ChtmlPhoneCallAdapter.cs
- CloudCollection.cs
- Maps.cs
- Input.cs
- PowerStatus.cs
- Triplet.cs
- XamlReaderHelper.cs
- TextSelectionProcessor.cs
- PageCatalogPart.cs
- CompressedStack.cs
- Evidence.cs
- WebEventTraceProvider.cs
- DelegateOutArgument.cs
- QuotedPrintableStream.cs
- BooleanConverter.cs
- AnimationClockResource.cs
- XmlParser.cs
- DashStyle.cs
- XMLDiffLoader.cs
- TextEditorContextMenu.cs
- ProxyFragment.cs
- InlineUIContainer.cs
- SemaphoreFullException.cs
- CodeAttributeArgumentCollection.cs
- Stackframe.cs
- ManagedCodeMarkers.cs
- WriteTimeStream.cs
- Bezier.cs
- EdmComplexPropertyAttribute.cs
- IHttpResponseInternal.cs
- RequestChannel.cs
- FormViewInsertEventArgs.cs
- FtpWebRequest.cs
- ToolStripItemEventArgs.cs
- Matrix3D.cs
- OdbcDataAdapter.cs
- CalendarDataBindingHandler.cs
- EmbeddedObject.cs
- HotCommands.cs
- SessionStateUtil.cs
- UdpReplyToBehavior.cs
- WpfGeneratedKnownTypes.cs
- CssTextWriter.cs
- Misc.cs
- BasicHttpBindingCollectionElement.cs
- ClonableStack.cs
- sqlinternaltransaction.cs
- EditorResources.cs
- NonSerializedAttribute.cs
- RecordBuilder.cs
- ListSortDescription.cs
- StateInitialization.cs
- ExpressionBuilderContext.cs
- ProcessHostMapPath.cs
- KernelTypeValidation.cs
- SecurityHelper.cs
- InstanceCreationEditor.cs
- Helpers.cs
- WebPartConnectionCollection.cs
- TraceEventCache.cs
- TextFindEngine.cs
- DiagnosticStrings.cs
- PropertyDescriptorCollection.cs
- DispatchWrapper.cs
- WebDisplayNameAttribute.cs
- Axis.cs
- ProviderConnectionPoint.cs
- CreateInstanceBinder.cs
- SpeechSynthesizer.cs
- MethodToken.cs
- StringDictionaryCodeDomSerializer.cs
- DbConnectionPoolGroup.cs
- References.cs
- EntityModelBuildProvider.cs
- LoginUtil.cs
- DeploymentExceptionMapper.cs
- WindowsRebar.cs
- XmlElementAttribute.cs
- PlatformCulture.cs
- IISMapPath.cs
- StateMachineAction.cs
- FlowLayoutSettings.cs
- OdbcConnectionPoolProviderInfo.cs
- NativeRecognizer.cs
- ChildTable.cs
- SubMenuStyleCollectionEditor.cs
- PrintDialog.cs
- IndexedGlyphRun.cs
- SiteMapDataSource.cs