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
- SiteMap.cs
- SecUtil.cs
- COM2ComponentEditor.cs
- BezierSegment.cs
- SqlAliaser.cs
- MarkupExtensionParser.cs
- HtmlFormWrapper.cs
- WorkflowMarkupSerializerMapping.cs
- AnnotationComponentChooser.cs
- SmtpDigestAuthenticationModule.cs
- HashMembershipCondition.cs
- EntityClientCacheEntry.cs
- Page.cs
- UnsafeMethods.cs
- RC2.cs
- DeviceContexts.cs
- X509SecurityToken.cs
- Descriptor.cs
- StringPropertyBuilder.cs
- PixelFormatConverter.cs
- CodeEventReferenceExpression.cs
- CompareInfo.cs
- SharedStatics.cs
- SecurityResources.cs
- ProfileService.cs
- InfoCardSymmetricCrypto.cs
- TableLayoutPanelCellPosition.cs
- StylusPointPropertyInfo.cs
- shaperfactory.cs
- MouseBinding.cs
- XmlObjectSerializer.cs
- DataRelationPropertyDescriptor.cs
- ButtonBaseAutomationPeer.cs
- ConnectionPointCookie.cs
- WindowsIPAddress.cs
- RsaKeyIdentifierClause.cs
- TreeNodeEventArgs.cs
- Timer.cs
- SpeakCompletedEventArgs.cs
- PeerObject.cs
- StructuredTypeInfo.cs
- XmlCDATASection.cs
- Point3DKeyFrameCollection.cs
- XmlDataSourceNodeDescriptor.cs
- BitmapEffect.cs
- DataGridViewAccessibleObject.cs
- EntitySetDataBindingList.cs
- DataGrid.cs
- PathSegmentCollection.cs
- EventDescriptorCollection.cs
- ExpressionBinding.cs
- DataGridViewDataConnection.cs
- SoapHeaderAttribute.cs
- WorkflowWebService.cs
- QilInvokeLateBound.cs
- DBNull.cs
- MutexSecurity.cs
- ServiceHttpHandlerFactory.cs
- UpdatableWrapper.cs
- RotateTransform3D.cs
- LayoutDump.cs
- DrawingVisualDrawingContext.cs
- ContainerCodeDomSerializer.cs
- HMACSHA512.cs
- EncoderParameters.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- KeySplineConverter.cs
- DBParameter.cs
- Control.cs
- TemplatedAdorner.cs
- MembershipValidatePasswordEventArgs.cs
- OpenTypeLayout.cs
- SingleKeyFrameCollection.cs
- FixedSOMTableCell.cs
- OSEnvironmentHelper.cs
- SimpleRecyclingCache.cs
- DefaultValueAttribute.cs
- URIFormatException.cs
- InstanceKeyCollisionException.cs
- ByValueEqualityComparer.cs
- SchemaTableOptionalColumn.cs
- AlphaSortedEnumConverter.cs
- FormViewModeEventArgs.cs
- Trigger.cs
- MediaTimeline.cs
- PolicyStatement.cs
- XhtmlStyleClass.cs
- CustomAttributeBuilder.cs
- DispatcherSynchronizationContext.cs
- Expressions.cs
- WebSysDisplayNameAttribute.cs
- Parallel.cs
- Group.cs
- IPGlobalProperties.cs
- mansign.cs
- ViewStateAttachedPropertyFeature.cs
- NotifyParentPropertyAttribute.cs
- WebZoneDesigner.cs
- DataRecordInfo.cs
- PrintDialog.cs