Code:
/ DotNET / DotNET / 8.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
- TimelineGroup.cs
- SchemaTableColumn.cs
- BitmapEffectInput.cs
- GraphicsContext.cs
- WaitForChangedResult.cs
- MessageHeaderT.cs
- DataGridViewColumnEventArgs.cs
- RtfControls.cs
- CommandField.cs
- TemplateControl.cs
- Subtree.cs
- NameTable.cs
- StylusPlugin.cs
- IUnknownConstantAttribute.cs
- EpmContentSerializer.cs
- NullableDoubleAverageAggregationOperator.cs
- ConnectionManagementElementCollection.cs
- InvalidTimeZoneException.cs
- RSAPKCS1SignatureDeformatter.cs
- AttachedPropertyBrowsableForTypeAttribute.cs
- WorkflowViewService.cs
- NameValueConfigurationElement.cs
- XmlILModule.cs
- MiniParameterInfo.cs
- Attributes.cs
- ToolStripLabel.cs
- SafeRightsManagementHandle.cs
- XPathNode.cs
- ConfigXmlComment.cs
- ObjectDisposedException.cs
- MSHTMLHost.cs
- ColumnMapVisitor.cs
- ObjectSet.cs
- ListViewDataItem.cs
- IItemProperties.cs
- RangeContentEnumerator.cs
- DictionaryManager.cs
- ApplicationDirectoryMembershipCondition.cs
- ActiveXHost.cs
- cookie.cs
- MetaColumn.cs
- ValidationPropertyAttribute.cs
- GridViewColumnHeaderAutomationPeer.cs
- RepeatButtonAutomationPeer.cs
- ImportContext.cs
- MarkupCompilePass2.cs
- ActiveDocumentEvent.cs
- ParserExtension.cs
- DiscoveryClientReferences.cs
- ClipboardProcessor.cs
- DataControlFieldsEditor.cs
- DataBindingsDialog.cs
- metadatamappinghashervisitor.hashsourcebuilder.cs
- TracedNativeMethods.cs
- SqlServer2KCompatibilityCheck.cs
- DateTimeStorage.cs
- StatusBarPanel.cs
- _LoggingObject.cs
- SoundPlayer.cs
- EncoderFallback.cs
- MethodExpr.cs
- ObjectToken.cs
- SessionEndedEventArgs.cs
- StdValidatorsAndConverters.cs
- cookiecontainer.cs
- SqlConnectionPoolGroupProviderInfo.cs
- ProtocolsConfigurationEntry.cs
- HttpFileCollectionBase.cs
- CollectionCodeDomSerializer.cs
- _PooledStream.cs
- DebugInfoGenerator.cs
- DefaultShape.cs
- CodeNamespaceImport.cs
- UnSafeCharBuffer.cs
- CollectionBase.cs
- PenThreadPool.cs
- StringAnimationUsingKeyFrames.cs
- serverconfig.cs
- BasicCommandTreeVisitor.cs
- _NegotiateClient.cs
- TypefaceMap.cs
- BlobPersonalizationState.cs
- RoleBoolean.cs
- Utils.cs
- ToolBarButton.cs
- QueryStringConverter.cs
- CharUnicodeInfo.cs
- Trace.cs
- ThemeableAttribute.cs
- StreamHelper.cs
- DesignerAttribute.cs
- DesignerActionUIStateChangeEventArgs.cs
- Perspective.cs
- WebPartZoneDesigner.cs
- ControlOperationBehavior.cs
- FormViewDeletedEventArgs.cs
- TextRangeAdaptor.cs
- ExpressionNormalizer.cs
- SQLInt16Storage.cs
- PropertyIDSet.cs