Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / WinForms / Managed / System / WinForms / DropSource.cs / 1305376 / 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.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BroadcastEventHelper.cs
- Drawing.cs
- XmlSchemaAll.cs
- MSAANativeProvider.cs
- ParamArrayAttribute.cs
- MenuRendererClassic.cs
- SemanticTag.cs
- TokenizerHelper.cs
- BackgroundWorker.cs
- XmlChoiceIdentifierAttribute.cs
- GraphicsState.cs
- TrackingServices.cs
- Currency.cs
- DataRelationCollection.cs
- HotSpot.cs
- TemplateBamlRecordReader.cs
- ListBoxItemWrapperAutomationPeer.cs
- RoutedEventValueSerializer.cs
- SqlProcedureAttribute.cs
- HyperLink.cs
- FontFamily.cs
- DataGridBoolColumn.cs
- KnownTypes.cs
- CustomBindingElementCollection.cs
- ComplexPropertyEntry.cs
- SoapInteropTypes.cs
- HttpContextWrapper.cs
- TimeSpanConverter.cs
- WSSecurityPolicy12.cs
- FrameworkPropertyMetadata.cs
- TextSelectionProcessor.cs
- ProxyFragment.cs
- SpellerHighlightLayer.cs
- HttpHandlerActionCollection.cs
- BamlCollectionHolder.cs
- HandlerBase.cs
- Debugger.cs
- NameValueCollection.cs
- OracleConnectionStringBuilder.cs
- WindowsTokenRoleProvider.cs
- Block.cs
- SiteOfOriginContainer.cs
- SparseMemoryStream.cs
- BCLDebug.cs
- errorpatternmatcher.cs
- StringStorage.cs
- ClientProxyGenerator.cs
- AuthenticationException.cs
- InstanceLockException.cs
- SemanticResolver.cs
- MappingItemCollection.cs
- AesManaged.cs
- PropertyDescriptor.cs
- HostedNamedPipeTransportManager.cs
- ExternalException.cs
- FactoryRecord.cs
- RemoteHelper.cs
- TextBoxDesigner.cs
- PublisherIdentityPermission.cs
- unsafeIndexingFilterStream.cs
- TextElementCollection.cs
- TypeBrowserDialog.cs
- StylusButtonEventArgs.cs
- GrammarBuilder.cs
- ToolboxDataAttribute.cs
- SystemIcmpV6Statistics.cs
- Ticks.cs
- HttpCachePolicyBase.cs
- XmlName.cs
- MarshalByValueComponent.cs
- BamlTreeUpdater.cs
- DataGridViewLayoutData.cs
- RowTypePropertyElement.cs
- ResXResourceReader.cs
- SqlUtil.cs
- assertwrapper.cs
- TraceEventCache.cs
- ConnectionManagementSection.cs
- DynamicField.cs
- EnumValidator.cs
- CodeDirectiveCollection.cs
- HMACSHA512.cs
- GrammarBuilderBase.cs
- StrokeFIndices.cs
- ListViewItem.cs
- DispatcherSynchronizationContext.cs
- PersistenceProvider.cs
- OneOfConst.cs
- CryptoHelper.cs
- BitmapFrame.cs
- ColorTransform.cs
- ClientData.cs
- SecondaryIndexDefinition.cs
- RsaSecurityToken.cs
- HwndHostAutomationPeer.cs
- altserialization.cs
- TabControlEvent.cs
- PathGradientBrush.cs
- HostProtectionPermission.cs
- ImageFormat.cs