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
- CheckBoxAutomationPeer.cs
- ButtonPopupAdapter.cs
- RTTrackingProfile.cs
- AppDomainAttributes.cs
- FirstQueryOperator.cs
- SqlDataSourceQueryEditorForm.cs
- TextServicesCompartmentContext.cs
- WinInet.cs
- LicenseManager.cs
- Logging.cs
- SchemaType.cs
- ComponentManagerBroker.cs
- SplitterEvent.cs
- Splitter.cs
- GenericWebPart.cs
- TemplateBuilder.cs
- UriTemplatePathSegment.cs
- FlowStep.cs
- ComponentResourceManager.cs
- DecoderReplacementFallback.cs
- RoutedPropertyChangedEventArgs.cs
- Flowchart.cs
- XmlBoundElement.cs
- OdbcConnectionFactory.cs
- DecimalConstantAttribute.cs
- ConfigurationSectionGroup.cs
- RichTextBoxDesigner.cs
- ClientViaElement.cs
- MailWriter.cs
- BinaryObjectReader.cs
- ProcessInputEventArgs.cs
- EventMappingSettingsCollection.cs
- TreeNodeMouseHoverEvent.cs
- SetStoryboardSpeedRatio.cs
- EventBuilder.cs
- PkcsMisc.cs
- RSAPKCS1SignatureDeformatter.cs
- TreeBuilderBamlTranslator.cs
- grammarelement.cs
- DataGridViewButtonCell.cs
- MembershipValidatePasswordEventArgs.cs
- Size3DValueSerializer.cs
- EventTrigger.cs
- EmptyControlCollection.cs
- SequenceFullException.cs
- StructuralComparisons.cs
- DataGridCommandEventArgs.cs
- FileLoadException.cs
- InvalidCastException.cs
- DataGridPreparingCellForEditEventArgs.cs
- StreamMarshaler.cs
- ReceiveMessageAndVerifySecurityAsyncResultBase.cs
- IxmlLineInfo.cs
- SystemParameters.cs
- ContentElement.cs
- DataViewSetting.cs
- Completion.cs
- LinqDataSourceContextData.cs
- MatrixAnimationUsingPath.cs
- HandleDictionary.cs
- StyleCollection.cs
- ResourceBinder.cs
- DecimalStorage.cs
- VersionedStreamOwner.cs
- DefaultHttpHandler.cs
- GenericsInstances.cs
- WebService.cs
- SafeCancelMibChangeNotify.cs
- FileEnumerator.cs
- GZipUtils.cs
- CompilerHelpers.cs
- ScriptComponentDescriptor.cs
- DataColumnCollection.cs
- DrawingAttributeSerializer.cs
- NativeMethods.cs
- FileSystemEventArgs.cs
- Deserializer.cs
- relpropertyhelper.cs
- InternalDispatchObject.cs
- ErrorsHelper.cs
- ProxyWebPartConnectionCollection.cs
- PrintPreviewGraphics.cs
- NetSectionGroup.cs
- NameTable.cs
- HttpValueCollection.cs
- WorkerRequest.cs
- SHA256Cng.cs
- ControlPropertyNameConverter.cs
- RuntimeEnvironment.cs
- NonPrimarySelectionGlyph.cs
- GeneralTransform3DGroup.cs
- CompileXomlTask.cs
- CellNormalizer.cs
- XmlnsDictionary.cs
- OpacityConverter.cs
- LayoutManager.cs
- ContextStack.cs
- PointConverter.cs
- PageSettings.cs
- RC2CryptoServiceProvider.cs