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
- WizardPanel.cs
- ComplexPropertyEntry.cs
- SmtpFailedRecipientException.cs
- DataListItemCollection.cs
- NamedPermissionSet.cs
- WindowsMenu.cs
- RefreshEventArgs.cs
- smtppermission.cs
- FastEncoder.cs
- AppModelKnownContentFactory.cs
- ChannelTokenTypeConverter.cs
- SqlDataSource.cs
- Compiler.cs
- MeasureItemEvent.cs
- BitStack.cs
- CallContext.cs
- ObservableCollection.cs
- WrapPanel.cs
- Stacktrace.cs
- XmlObjectSerializerContext.cs
- IconBitmapDecoder.cs
- ButtonChrome.cs
- XmlDomTextWriter.cs
- Image.cs
- ProcessModelSection.cs
- SqlAggregateChecker.cs
- DictionaryContent.cs
- XmlSchemaSequence.cs
- MimeWriter.cs
- DbBuffer.cs
- WaitHandleCannotBeOpenedException.cs
- ScrollEventArgs.cs
- CommonDialog.cs
- StreamMarshaler.cs
- LazyInitializer.cs
- AutomationProperty.cs
- ProfileSettingsCollection.cs
- CompositeScriptReference.cs
- CodeGenerator.cs
- DisplayToken.cs
- ProcessHostServerConfig.cs
- Vector3DAnimationBase.cs
- ByteRangeDownloader.cs
- InlinedAggregationOperatorEnumerator.cs
- HtmlElement.cs
- ComboBoxItem.cs
- MulticastOption.cs
- PixelFormatConverter.cs
- EnumerationRangeValidationUtil.cs
- SQLMoneyStorage.cs
- DoubleCollection.cs
- DesignerDeviceConfig.cs
- PageContent.cs
- ClientFactory.cs
- _AcceptOverlappedAsyncResult.cs
- XmlWrappingWriter.cs
- ServiceBuildProvider.cs
- LinkTarget.cs
- StorageAssociationTypeMapping.cs
- Polygon.cs
- Emitter.cs
- NameValueCollection.cs
- ComNativeDescriptor.cs
- EntityViewGenerationAttribute.cs
- SqlDependency.cs
- SystemIPInterfaceStatistics.cs
- ContextItemManager.cs
- ValidationEventArgs.cs
- EmissiveMaterial.cs
- ButtonChrome.cs
- CodeMethodReturnStatement.cs
- AttributeAction.cs
- SQLUtility.cs
- safesecurityhelperavalon.cs
- HostingEnvironmentException.cs
- BufferedGraphicsContext.cs
- CategoryList.cs
- StrongTypingException.cs
- CompareInfo.cs
- ObjectStateFormatter.cs
- ElasticEase.cs
- TextEditorCopyPaste.cs
- GeneralTransform3DTo2DTo3D.cs
- ScriptManager.cs
- ElementMarkupObject.cs
- AppliedDeviceFiltersEditor.cs
- _TLSstream.cs
- GlyphTypeface.cs
- VisualProxy.cs
- RestHandler.cs
- DocumentViewerBase.cs
- AuthenticationServiceManager.cs
- ServiceMemoryGates.cs
- XmlExpressionDumper.cs
- FamilyTypeface.cs
- BamlRecordWriter.cs
- WmlControlAdapter.cs
- SQLByte.cs
- CapabilitiesAssignment.cs
- UInt64Storage.cs