Code:
/ FX-1434 / FX-1434 / 1.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
- ApplicationException.cs
- RankException.cs
- AutoSizeComboBox.cs
- ManagedFilter.cs
- PageSettings.cs
- ChannelManager.cs
- ServicesExceptionNotHandledEventArgs.cs
- ZipIOExtraFieldPaddingElement.cs
- LateBoundChannelParameterCollection.cs
- Bookmark.cs
- ResourceExpressionBuilder.cs
- ServiceProviders.cs
- VectorAnimation.cs
- SecUtil.cs
- UserPreferenceChangingEventArgs.cs
- CodeNamespaceImport.cs
- CheckBoxFlatAdapter.cs
- HiddenFieldPageStatePersister.cs
- ToolStripContainer.cs
- DataFormat.cs
- FieldTemplateUserControl.cs
- CaretElement.cs
- CaseCqlBlock.cs
- DependencyPropertyChangedEventArgs.cs
- ActivityExecutorSurrogate.cs
- LinqExpressionNormalizer.cs
- MembershipSection.cs
- CodeLinePragma.cs
- DataContractSerializerSection.cs
- LifetimeServices.cs
- DatatypeImplementation.cs
- TextTreeUndoUnit.cs
- UnknownExceptionActionHelper.cs
- FlowDocumentView.cs
- ResourceWriter.cs
- X500Name.cs
- AutoGeneratedField.cs
- XPathNavigatorReader.cs
- RegexCapture.cs
- WebPartCatalogAddVerb.cs
- ADConnectionHelper.cs
- NotSupportedException.cs
- CodeChecksumPragma.cs
- IndicCharClassifier.cs
- FileVersionInfo.cs
- _WinHttpWebProxyDataBuilder.cs
- WebEvents.cs
- PolyBezierSegment.cs
- CustomCategoryAttribute.cs
- PathTooLongException.cs
- SQLStringStorage.cs
- VirtualDirectoryMapping.cs
- ITextView.cs
- PrinterUnitConvert.cs
- XamlContextStack.cs
- StyleTypedPropertyAttribute.cs
- DataGridToolTip.cs
- Group.cs
- TextServicesProperty.cs
- LocationSectionRecord.cs
- XmlParserContext.cs
- ShaderEffect.cs
- TemplateBuilder.cs
- Int32Converter.cs
- Margins.cs
- StorageMappingItemLoader.cs
- ServerIdentity.cs
- Pointer.cs
- ToolStripControlHost.cs
- XmlILAnnotation.cs
- MetabaseServerConfig.cs
- ManagementQuery.cs
- NavigatingCancelEventArgs.cs
- InputMethodStateTypeInfo.cs
- RectangleGeometry.cs
- DesignerVerbCollection.cs
- XmlSchemaParticle.cs
- XmlChildNodes.cs
- SafeNativeMethodsCLR.cs
- Buffer.cs
- URLIdentityPermission.cs
- OdbcException.cs
- WebPartTransformer.cs
- ConfigXmlElement.cs
- BitmapEffectCollection.cs
- TemplateControlParser.cs
- DataRecordInfo.cs
- Property.cs
- ObjectContextServiceProvider.cs
- DataTableExtensions.cs
- SafeRightsManagementEnvironmentHandle.cs
- unsafenativemethodstextservices.cs
- XmlNavigatorFilter.cs
- Pen.cs
- DotAtomReader.cs
- ALinqExpressionVisitor.cs
- DesignerHelpers.cs
- TreeNodeBindingCollection.cs
- DataServiceClientException.cs
- BrowserTree.cs