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
- XmlSchemaExporter.cs
- IdnElement.cs
- NullableBoolConverter.cs
- FontDriver.cs
- ReflectionTypeLoadException.cs
- ZipFileInfo.cs
- StrokeNodeOperations2.cs
- DrawingContextDrawingContextWalker.cs
- TimeManager.cs
- TextEditor.cs
- ParameterReplacerVisitor.cs
- CharEnumerator.cs
- ObjectToken.cs
- HttpListenerRequestTraceRecord.cs
- StringCollection.cs
- SqlDuplicator.cs
- webclient.cs
- XmlUtf8RawTextWriter.cs
- IERequestCache.cs
- Site.cs
- DummyDataSource.cs
- List.cs
- HelpOperationInvoker.cs
- DESCryptoServiceProvider.cs
- MarkupExtensionParser.cs
- M3DUtil.cs
- XamlRtfConverter.cs
- UshortList2.cs
- DataGridViewComboBoxColumn.cs
- SmtpDateTime.cs
- QuadraticEase.cs
- SymLanguageType.cs
- DecoderFallbackWithFailureFlag.cs
- DbgUtil.cs
- DataGridViewCheckBoxColumn.cs
- GradientSpreadMethodValidation.cs
- TerminatorSinks.cs
- EntitySqlQueryBuilder.cs
- DataPagerFieldCollection.cs
- FullTextState.cs
- Random.cs
- CacheHelper.cs
- WeakReferenceList.cs
- SqlComparer.cs
- FontCacheUtil.cs
- CompiledQueryCacheKey.cs
- MatrixIndependentAnimationStorage.cs
- PageHandlerFactory.cs
- EventBuilder.cs
- ConfigXmlWhitespace.cs
- AnimationStorage.cs
- X509SecurityTokenParameters.cs
- StatusBar.cs
- PerformanceCounterManager.cs
- ObjectPersistData.cs
- StatusBarPanel.cs
- SecurityUtils.cs
- ProcessHostServerConfig.cs
- ListViewItemMouseHoverEvent.cs
- SynchronizedPool.cs
- AdapterDictionary.cs
- UnsafeNativeMethods.cs
- XamlInterfaces.cs
- ParameterToken.cs
- XamlTypeMapperSchemaContext.cs
- PropertyMap.cs
- EventListenerClientSide.cs
- ReadOnlyDictionary.cs
- _ListenerRequestStream.cs
- Missing.cs
- SqlTriggerContext.cs
- GroupByQueryOperator.cs
- ComboBox.cs
- HtmlFormWrapper.cs
- TableTextElementCollectionInternal.cs
- DatePickerAutomationPeer.cs
- RootProfilePropertySettingsCollection.cs
- EncodingTable.cs
- SelectionItemProviderWrapper.cs
- QueryComponents.cs
- X509Chain.cs
- HandlerBase.cs
- OrderedHashRepartitionEnumerator.cs
- TypeDescriptor.cs
- SHA384Managed.cs
- BaseTemplateCodeDomTreeGenerator.cs
- ReadOnlyDictionary.cs
- DbUpdateCommandTree.cs
- EngineSiteSapi.cs
- MenuItemStyle.cs
- AxHost.cs
- DisplayNameAttribute.cs
- TextEndOfLine.cs
- ExecutionContext.cs
- ScriptIgnoreAttribute.cs
- ObfuscateAssemblyAttribute.cs
- Propagator.cs
- TypeBuilderInstantiation.cs
- PagesSection.cs
- RegistryPermission.cs