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
- TableLayoutStyle.cs
- DateTimeFormat.cs
- StrokeNodeOperations.cs
- DataServiceRequestArgs.cs
- safemediahandle.cs
- CorrelationManager.cs
- GetLedgerEntryForRecipientRequest.cs
- WebPartsSection.cs
- FontNameConverter.cs
- codemethodreferenceexpression.cs
- TiffBitmapEncoder.cs
- Win32.cs
- SequenceDesignerAccessibleObject.cs
- SizeChangedInfo.cs
- XmlQueryRuntime.cs
- PersonalizationStateQuery.cs
- DataGridViewCellMouseEventArgs.cs
- FlowDocumentPageViewerAutomationPeer.cs
- TextHidden.cs
- ValidationPropertyAttribute.cs
- DBSchemaRow.cs
- SessionStateContainer.cs
- CfgParser.cs
- ImageFormatConverter.cs
- columnmapfactory.cs
- IPEndPoint.cs
- GeneralTransform3DTo2D.cs
- CodeGenHelper.cs
- JumpTask.cs
- EdgeModeValidation.cs
- __ComObject.cs
- AsyncStreamReader.cs
- ToolStripSystemRenderer.cs
- DocumentViewerHelper.cs
- BaseServiceProvider.cs
- XslTransform.cs
- AuditLog.cs
- QueryInterceptorAttribute.cs
- SystemWebCachingSectionGroup.cs
- SourceInterpreter.cs
- ProcessHost.cs
- _SslSessionsCache.cs
- Vector3DCollection.cs
- WriteableBitmap.cs
- BasicExpressionVisitor.cs
- SurrogateEncoder.cs
- ContextQuery.cs
- DrawingAttributes.cs
- MetadataItemEmitter.cs
- CodeSnippetTypeMember.cs
- CurrencyManager.cs
- IsolatedStorageException.cs
- autovalidator.cs
- SoundPlayerAction.cs
- MultilineStringConverter.cs
- NamespaceCollection.cs
- mactripleDES.cs
- SafeRightsManagementPubHandle.cs
- UserNameSecurityTokenProvider.cs
- IPEndPoint.cs
- GenericXmlSecurityToken.cs
- XmlObjectSerializerContext.cs
- Comparer.cs
- QueryCacheKey.cs
- LabelAutomationPeer.cs
- ToolZone.cs
- DbConnectionStringBuilder.cs
- CancellationHandlerDesigner.cs
- RootCodeDomSerializer.cs
- Vector3DIndependentAnimationStorage.cs
- HierarchicalDataBoundControlAdapter.cs
- EmbeddedMailObjectsCollection.cs
- FragmentNavigationEventArgs.cs
- XmlUtf8RawTextWriter.cs
- DockAndAnchorLayout.cs
- EventLogEntryCollection.cs
- XPathItem.cs
- GridItemCollection.cs
- Root.cs
- AnnouncementInnerClientCD1.cs
- XmlIlGenerator.cs
- Baml2006ReaderFrame.cs
- HttpApplicationStateBase.cs
- ValidationEventArgs.cs
- XmlSignificantWhitespace.cs
- SetMemberBinder.cs
- xml.cs
- MailDefinition.cs
- MobileListItem.cs
- CheckoutException.cs
- TemplatedMailWebEventProvider.cs
- SelectionEditingBehavior.cs
- JoinSymbol.cs
- SchemaExporter.cs
- FontDifferentiator.cs
- ResourceExpression.cs
- GeometryConverter.cs
- MethodExpr.cs
- ConnectionManager.cs
- UnionCqlBlock.cs