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
- Size3D.cs
- DocumentPaginator.cs
- xsdvalidator.cs
- CornerRadiusConverter.cs
- DataChangedEventManager.cs
- DesignerActionPropertyItem.cs
- TabItemAutomationPeer.cs
- WebPartTransformer.cs
- ObjectFactoryCodeDomTreeGenerator.cs
- NullRuntimeConfig.cs
- Tracer.cs
- DelegateHelpers.Generated.cs
- Config.cs
- FontFaceLayoutInfo.cs
- ExceptionNotification.cs
- CallId.cs
- StateMachineSubscription.cs
- TextMetrics.cs
- HMACSHA256.cs
- InputMethodStateTypeInfo.cs
- PageClientProxyGenerator.cs
- baseshape.cs
- TargetInvocationException.cs
- StatusBarPanel.cs
- Component.cs
- CachedTypeface.cs
- HttpHandlersSection.cs
- PropertyInformationCollection.cs
- DependencyProperty.cs
- COM2ExtendedUITypeEditor.cs
- RuntimeEnvironment.cs
- SmiEventSink_Default.cs
- JsonStringDataContract.cs
- QueryProcessor.cs
- JsonWriter.cs
- BindingExpressionBase.cs
- XslCompiledTransform.cs
- PolicyDesigner.cs
- RichListBox.cs
- SerializeAbsoluteContext.cs
- ContactManager.cs
- XmlObjectSerializerWriteContext.cs
- ExtentKey.cs
- ObjectQueryState.cs
- SystemIPInterfaceStatistics.cs
- ColorAnimationBase.cs
- DropSource.cs
- NavigationCommands.cs
- WebPartZone.cs
- Geometry3D.cs
- ProcessInputEventArgs.cs
- DictionaryBase.cs
- DbConnectionPool.cs
- DbXmlEnabledProviderManifest.cs
- ProfileBuildProvider.cs
- SqlAggregateChecker.cs
- TypedRowHandler.cs
- Shape.cs
- WinHttpWebProxyFinder.cs
- RequestQueue.cs
- ConfigXmlSignificantWhitespace.cs
- TrackingProfileSerializer.cs
- TemplateBaseAction.cs
- DataGridState.cs
- EDesignUtil.cs
- CompositeControlDesigner.cs
- NewArrayExpression.cs
- StandardTransformFactory.cs
- GACIdentityPermission.cs
- PlanCompiler.cs
- CrossContextChannel.cs
- OutgoingWebResponseContext.cs
- PolicyStatement.cs
- XmlQueryStaticData.cs
- DataSourceXmlClassAttribute.cs
- Rect3D.cs
- ServiceEndpointElementCollection.cs
- AstTree.cs
- XmlSchemaSet.cs
- DateTimePicker.cs
- XamlNamespaceHelper.cs
- AuthenticationModuleElementCollection.cs
- SqlTriggerContext.cs
- EmptyCollection.cs
- SQLStringStorage.cs
- TimeSpanSecondsOrInfiniteConverter.cs
- JournalEntryListConverter.cs
- XmlNotation.cs
- SmiContextFactory.cs
- ZipIOExtraFieldElement.cs
- DescendantQuery.cs
- CacheModeValueSerializer.cs
- ParseHttpDate.cs
- FrameworkEventSource.cs
- ProfileSection.cs
- SyndicationSerializer.cs
- IntSecurity.cs
- DataSourceCacheDurationConverter.cs
- WrappedIUnknown.cs
- CodeExporter.cs