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
- TextFormatterImp.cs
- BmpBitmapEncoder.cs
- RandomNumberGenerator.cs
- GraphicsPath.cs
- Roles.cs
- TableRow.cs
- TypeKeyValue.cs
- LocatorPartList.cs
- TextEndOfLine.cs
- HttpBufferlessInputStream.cs
- NaturalLanguageHyphenator.cs
- DataGridViewLayoutData.cs
- ViewBase.cs
- Number.cs
- XmlSerializerVersionAttribute.cs
- CodeNamespaceCollection.cs
- XmlReflectionMember.cs
- CallbackHandler.cs
- KnownColorTable.cs
- CodeDOMUtility.cs
- DelegateBodyWriter.cs
- ZoneButton.cs
- StringKeyFrameCollection.cs
- ArrayWithOffset.cs
- Propagator.JoinPropagator.JoinPredicateVisitor.cs
- RtfControls.cs
- FlowDocumentPaginator.cs
- ClientOptions.cs
- oledbmetadatacolumnnames.cs
- Win32PrintDialog.cs
- EventListener.cs
- SingleAnimationUsingKeyFrames.cs
- AppManager.cs
- EventKeyword.cs
- ToolTip.cs
- Mutex.cs
- Padding.cs
- XmlLinkedNode.cs
- HtmlHead.cs
- SoapElementAttribute.cs
- SqlStatistics.cs
- Control.cs
- DefaultParameterValueAttribute.cs
- CancelEventArgs.cs
- Transform3D.cs
- MethodCallConverter.cs
- Internal.cs
- ImageBrush.cs
- XamlDesignerSerializationManager.cs
- XmlAttributeOverrides.cs
- RestHandler.cs
- PixelFormat.cs
- SocketException.cs
- DataServiceHostFactory.cs
- M3DUtil.cs
- VirtualDirectoryMapping.cs
- ThaiBuddhistCalendar.cs
- LeftCellWrapper.cs
- ValidatorCompatibilityHelper.cs
- SafeLocalMemHandle.cs
- DatePickerAutomationPeer.cs
- TagMapCollection.cs
- _OverlappedAsyncResult.cs
- DataControlPagerLinkButton.cs
- ToolboxItem.cs
- MinimizableAttributeTypeConverter.cs
- ObjRef.cs
- SmtpMail.cs
- SafeNativeMethods.cs
- DataTableClearEvent.cs
- ThousandthOfEmRealPoints.cs
- Line.cs
- RemotingSurrogateSelector.cs
- ExtentKey.cs
- CodeTypeDeclaration.cs
- RootBuilder.cs
- DesignTimeSiteMapProvider.cs
- CachedCompositeFamily.cs
- MessageBox.cs
- CompiledIdentityConstraint.cs
- OpenTypeMethods.cs
- SqlUDTStorage.cs
- mactripleDES.cs
- HostedTransportConfigurationBase.cs
- EntityDataSourceContextCreatedEventArgs.cs
- Timeline.cs
- Membership.cs
- AutomationPatternInfo.cs
- TreeNodeSelectionProcessor.cs
- BufferModeSettings.cs
- EntityDataSource.cs
- TableChangeProcessor.cs
- ImageButton.cs
- SQLConvert.cs
- DriveNotFoundException.cs
- QueryExecutionOption.cs
- SerTrace.cs
- Emitter.cs
- TabItemAutomationPeer.cs
- InternalConfigRoot.cs