Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / whidbey / NetFxQFE / 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. // //----------------------------------------------------------------------------- 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
- SelectionPatternIdentifiers.cs
- ForeignKeyConstraint.cs
- WindowsSecurityTokenAuthenticator.cs
- CLSCompliantAttribute.cs
- EdgeProfileValidation.cs
- ProfilePropertySettingsCollection.cs
- BuildResult.cs
- AtlasWeb.Designer.cs
- BinHexDecoder.cs
- SqlParameterizer.cs
- DeadCharTextComposition.cs
- ExtenderProvidedPropertyAttribute.cs
- Overlapped.cs
- OperationDescriptionCollection.cs
- PolyLineSegmentFigureLogic.cs
- Transform.cs
- DataServiceQueryOfT.cs
- MD5.cs
- TemplatePartAttribute.cs
- DoWorkEventArgs.cs
- CodeObject.cs
- DispatcherBuilder.cs
- TextReader.cs
- OuterGlowBitmapEffect.cs
- WebPartEditorApplyVerb.cs
- DataReaderContainer.cs
- EllipticalNodeOperations.cs
- ItemsControlAutomationPeer.cs
- HostingEnvironmentException.cs
- TraceHandlerErrorFormatter.cs
- SchemaMapping.cs
- XmlCustomFormatter.cs
- WorkflowDesignerColors.cs
- BindingExpression.cs
- EntityAdapter.cs
- COM2FontConverter.cs
- ConfigurationStrings.cs
- ProcessStartInfo.cs
- CommonXSendMessage.cs
- GeneralTransform3DTo2DTo3D.cs
- DataFormat.cs
- SpeechDetectedEventArgs.cs
- FloatUtil.cs
- EdmItemCollection.OcAssemblyCache.cs
- RegexCapture.cs
- ColumnClickEvent.cs
- EndEvent.cs
- QilGeneratorEnv.cs
- ReliableMessagingVersion.cs
- TemplateKeyConverter.cs
- PermissionAttributes.cs
- DockProviderWrapper.cs
- NetworkInterface.cs
- CustomAttribute.cs
- DetailsView.cs
- TextModifierScope.cs
- PackageDigitalSignatureManager.cs
- FontUnit.cs
- DataGridViewRowCollection.cs
- ScrollBar.cs
- PropertyPushdownHelper.cs
- DbConnectionHelper.cs
- DataGridColumnFloatingHeader.cs
- XmlCollation.cs
- TcpServerChannel.cs
- CatalogPart.cs
- TextDecorationCollection.cs
- MessagePropertyAttribute.cs
- TextBox.cs
- SqlDataSourceCommandEventArgs.cs
- SafeEventLogReadHandle.cs
- mda.cs
- ChannelParameterCollection.cs
- FilteredDataSetHelper.cs
- StringKeyFrameCollection.cs
- CodeCatchClauseCollection.cs
- Vector.cs
- WebPartConnectVerb.cs
- StateMachineWorkflowInstance.cs
- VirtualizingPanel.cs
- TextBoxAutoCompleteSourceConverter.cs
- DataGridViewCellCancelEventArgs.cs
- mansign.cs
- InputEventArgs.cs
- Not.cs
- Figure.cs
- DataPagerFieldCollection.cs
- DataGridViewAdvancedBorderStyle.cs
- TextBoxBase.cs
- RouteItem.cs
- LicenseManager.cs
- ResolveMatchesCD1.cs
- Substitution.cs
- Package.cs
- ThreadPoolTaskScheduler.cs
- __Filters.cs
- ProtectedConfigurationSection.cs
- SqlMethodCallConverter.cs
- SafeArrayTypeMismatchException.cs
- SqlProcedureAttribute.cs