Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- DataGridViewRowsRemovedEventArgs.cs
- MailAddress.cs
- List.cs
- TracingConnectionListener.cs
- EditorOptionAttribute.cs
- MaskInputRejectedEventArgs.cs
- XamlPointCollectionSerializer.cs
- WindowsEditBox.cs
- HttpResponse.cs
- StrongNameHelpers.cs
- ThreadAbortException.cs
- AsyncInvokeContext.cs
- ScrollChangedEventArgs.cs
- Page.cs
- ContextStack.cs
- CompositeFontFamily.cs
- StringValidator.cs
- SerializationInfo.cs
- cache.cs
- XNodeNavigator.cs
- SymDocumentType.cs
- PenCursorManager.cs
- MethodExpr.cs
- PageMediaSize.cs
- HotCommands.cs
- ComponentEditorPage.cs
- DataGridViewRowHeightInfoPushedEventArgs.cs
- TableRowGroup.cs
- IteratorDescriptor.cs
- HideDisabledControlAdapter.cs
- RepeatBehavior.cs
- IIS7UserPrincipal.cs
- TreeView.cs
- AsyncStreamReader.cs
- SizeAnimationUsingKeyFrames.cs
- BoundColumn.cs
- LogExtent.cs
- RowsCopiedEventArgs.cs
- RenderData.cs
- ButtonAutomationPeer.cs
- DataObjectMethodAttribute.cs
- PrintControllerWithStatusDialog.cs
- TemplateContent.cs
- HtmlInputFile.cs
- ZipIOLocalFileHeader.cs
- ValueUtilsSmi.cs
- UidManager.cs
- MyContact.cs
- AliasExpr.cs
- XPathConvert.cs
- RawStylusSystemGestureInputReport.cs
- hwndwrapper.cs
- NetworkInformationException.cs
- UnsafeNativeMethods.cs
- AnchoredBlock.cs
- SqlNamer.cs
- WebFormDesignerActionService.cs
- EventMappingSettings.cs
- Properties.cs
- AxisAngleRotation3D.cs
- StatusBarPanel.cs
- OnOperation.cs
- PackWebRequest.cs
- HierarchicalDataBoundControl.cs
- XmlParserContext.cs
- InstanceKey.cs
- DataViewSettingCollection.cs
- DBDataPermissionAttribute.cs
- ParserStreamGeometryContext.cs
- ByteStorage.cs
- ThreadStartException.cs
- Clock.cs
- KnownBoxes.cs
- OdbcInfoMessageEvent.cs
- RealizationContext.cs
- SizeChangedEventArgs.cs
- LineSegment.cs
- FieldBuilder.cs
- WinCategoryAttribute.cs
- DataGridHeaderBorder.cs
- InvokeWebService.cs
- SqlDataSourceSelectingEventArgs.cs
- CompensatableTransactionScopeActivity.cs
- WebPartDisplayModeCancelEventArgs.cs
- EditingContext.cs
- UncommonField.cs
- KnownTypeDataContractResolver.cs
- TextEditorLists.cs
- PerformanceCounterManager.cs
- EntryPointNotFoundException.cs
- WindowsListViewItemCheckBox.cs
- ResourcesBuildProvider.cs
- MarkerProperties.cs
- SecurityDescriptor.cs
- BitmapFrame.cs
- VisualStyleRenderer.cs
- WebPartDescriptionCollection.cs
- complextypematerializer.cs
- SecurityHelper.cs
- FixedDocumentSequencePaginator.cs