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
- QilChoice.cs
- Trigger.cs
- RangeValuePattern.cs
- _ScatterGatherBuffers.cs
- ProtocolInformationWriter.cs
- CookieHandler.cs
- DeclarationUpdate.cs
- PageWrapper.cs
- DataTablePropertyDescriptor.cs
- SimpleFieldTemplateFactory.cs
- ReservationCollection.cs
- printdlgexmarshaler.cs
- CachedBitmap.cs
- selecteditemcollection.cs
- TdsRecordBufferSetter.cs
- HttpCapabilitiesSectionHandler.cs
- ClientEventManager.cs
- XmlWriter.cs
- XmlSchemaValidationException.cs
- AutoResizedEvent.cs
- MergePropertyDescriptor.cs
- DnsPermission.cs
- ProcessModelSection.cs
- Queue.cs
- MetadataArtifactLoaderFile.cs
- InProcStateClientManager.cs
- QueryFunctions.cs
- DataBinding.cs
- MobileControlPersister.cs
- TextRange.cs
- WrappedIUnknown.cs
- IsolationInterop.cs
- TextElementEditingBehaviorAttribute.cs
- EventLogWatcher.cs
- unitconverter.cs
- TreeView.cs
- Double.cs
- SoapSchemaExporter.cs
- EditorZone.cs
- _PooledStream.cs
- NotifyCollectionChangedEventArgs.cs
- PathSegment.cs
- InstanceStore.cs
- SoapObjectInfo.cs
- WhitespaceReader.cs
- QueryAccessibilityHelpEvent.cs
- EdmComplexTypeAttribute.cs
- DWriteFactory.cs
- PrintPageEvent.cs
- ListItemCollection.cs
- TrackingMemoryStream.cs
- CalendarData.cs
- CommaDelimitedStringAttributeCollectionConverter.cs
- SystemTcpConnection.cs
- DataGridRow.cs
- SessionStateItemCollection.cs
- SHA384.cs
- BuildProviderCollection.cs
- UITypeEditor.cs
- WindowsListViewGroupSubsetLink.cs
- PageClientProxyGenerator.cs
- RequestNavigateEventArgs.cs
- StoreItemCollection.cs
- DoWorkEventArgs.cs
- CheckBoxStandardAdapter.cs
- CodeGroup.cs
- BoundPropertyEntry.cs
- ScalarConstant.cs
- FragmentQueryKB.cs
- CollectionView.cs
- SmiMetaData.cs
- TriState.cs
- InputMethodStateChangeEventArgs.cs
- DataGridViewCellStateChangedEventArgs.cs
- Graph.cs
- SafeNativeMemoryHandle.cs
- Signature.cs
- TextBoxDesigner.cs
- XmlDataDocument.cs
- DataGridHelper.cs
- Line.cs
- TextRangeEditLists.cs
- DetailsViewPagerRow.cs
- DesignerToolStripControlHost.cs
- ForEachAction.cs
- StylusPointProperty.cs
- RectAnimationUsingKeyFrames.cs
- TimeSpanConverter.cs
- CopyNamespacesAction.cs
- OperationResponse.cs
- VirtualizingPanel.cs
- BrowserDefinition.cs
- RequestCachePolicy.cs
- ComponentResourceManager.cs
- EntityDataSourceReferenceGroup.cs
- WebPart.cs
- CancellableEnumerable.cs
- dataSvcMapFileLoader.cs
- SqlGenericUtil.cs
- PropertyInfo.cs