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
- RequestCacheManager.cs
- ProcessInfo.cs
- KeyFrames.cs
- CorrelationTokenInvalidatedHandler.cs
- DataBindingList.cs
- DbMetaDataCollectionNames.cs
- ExpressionBuilderCollection.cs
- ViewEvent.cs
- FolderBrowserDialog.cs
- DataViewListener.cs
- HttpSocketManager.cs
- EnlistmentTraceIdentifier.cs
- Helper.cs
- ThicknessConverter.cs
- XsdDataContractExporter.cs
- AdvancedBindingEditor.cs
- ProviderCommandInfoUtils.cs
- StyleSheetRefUrlEditor.cs
- StickyNoteAnnotations.cs
- NameTable.cs
- SystemGatewayIPAddressInformation.cs
- WinEventWrap.cs
- CannotUnloadAppDomainException.cs
- Buffer.cs
- ConsoleTraceListener.cs
- Int32AnimationBase.cs
- _SafeNetHandles.cs
- UnknownMessageReceivedEventArgs.cs
- TextProperties.cs
- PerformanceCounterPermissionAttribute.cs
- DirectoryRootQuery.cs
- DataRowCollection.cs
- Funcletizer.cs
- MoveSizeWinEventHandler.cs
- RemotingClientProxy.cs
- JavaScriptObjectDeserializer.cs
- XPathQueryGenerator.cs
- EmptyStringExpandableObjectConverter.cs
- SplineKeyFrames.cs
- PageThemeCodeDomTreeGenerator.cs
- ReadOnlyHierarchicalDataSourceView.cs
- ModelPropertyCollectionImpl.cs
- EntityContainerEmitter.cs
- UTF8Encoding.cs
- ApplyTemplatesAction.cs
- FrameAutomationPeer.cs
- DetailsViewRow.cs
- COM2PropertyDescriptor.cs
- FormViewInsertedEventArgs.cs
- ComIntegrationManifestGenerator.cs
- RedirectionProxy.cs
- DataGridViewLinkCell.cs
- DataBinding.cs
- BinaryOperationBinder.cs
- TdsParameterSetter.cs
- ListenerSessionConnectionReader.cs
- UnSafeCharBuffer.cs
- InternalSafeNativeMethods.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- CompoundFileIOPermission.cs
- WebPartDisplayModeCancelEventArgs.cs
- DataBindingCollectionConverter.cs
- Translator.cs
- RMEnrollmentPage1.cs
- Rotation3D.cs
- SmtpSection.cs
- HostVisual.cs
- CompleteWizardStep.cs
- XmlComment.cs
- SQlBooleanStorage.cs
- RangeContentEnumerator.cs
- JapaneseCalendar.cs
- DataSourceControl.cs
- ImageBrush.cs
- RuntimeWrappedException.cs
- BaseInfoTable.cs
- ProcessModelSection.cs
- DoubleAverageAggregationOperator.cs
- TypeDescriptionProvider.cs
- CoordinationService.cs
- _BufferOffsetSize.cs
- XPathBinder.cs
- SqlDependencyUtils.cs
- RuleProcessor.cs
- PointHitTestResult.cs
- StaticTextPointer.cs
- UseAttributeSetsAction.cs
- ParameterBuilder.cs
- EDesignUtil.cs
- AttachedPropertiesService.cs
- DataBindingCollection.cs
- CodePropertyReferenceExpression.cs
- UniformGrid.cs
- TrustManagerMoreInformation.cs
- BaseConfigurationRecord.cs
- ProcessModule.cs
- TagMapInfo.cs
- ListViewItemSelectionChangedEvent.cs
- WebBrowser.cs
- SafeSecurityHelper.cs