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
- TripleDESCryptoServiceProvider.cs
- Error.cs
- SqlConnectionManager.cs
- DictionaryChange.cs
- FragmentNavigationEventArgs.cs
- StoragePropertyMapping.cs
- XPSSignatureDefinition.cs
- DataGridViewElement.cs
- InputScopeManager.cs
- PageStatePersister.cs
- XmlElementList.cs
- HttpRuntimeSection.cs
- NonBatchDirectoryCompiler.cs
- ZoneIdentityPermission.cs
- FigureHelper.cs
- MemberInfoSerializationHolder.cs
- OdbcHandle.cs
- NamespaceMapping.cs
- AssemblyInfo.cs
- ComponentRenameEvent.cs
- QuaternionRotation3D.cs
- DbProviderFactories.cs
- EtwTrace.cs
- ReadOnlyObservableCollection.cs
- XmlReader.cs
- EntityProxyFactory.cs
- Dictionary.cs
- TempFiles.cs
- RenderTargetBitmap.cs
- InternalDispatchObject.cs
- Msec.cs
- SupportsEventValidationAttribute.cs
- UrlMapping.cs
- _ConnectOverlappedAsyncResult.cs
- TextHidden.cs
- DropShadowBitmapEffect.cs
- XmlCharCheckingReader.cs
- UTF32Encoding.cs
- BridgeDataRecord.cs
- CqlErrorHelper.cs
- FreezableOperations.cs
- AuthorizationRule.cs
- SystemNetHelpers.cs
- DesignerCategoryAttribute.cs
- AutoGeneratedFieldProperties.cs
- ConfigurationSection.cs
- ControlIdConverter.cs
- RunClient.cs
- MouseGestureValueSerializer.cs
- CommandSet.cs
- ContentPosition.cs
- QilExpression.cs
- PassportAuthentication.cs
- BamlRecordHelper.cs
- ListViewInsertionMark.cs
- Span.cs
- DataMemberListEditor.cs
- Matrix3DConverter.cs
- OleDbError.cs
- FilteredReadOnlyMetadataCollection.cs
- TypePresenter.xaml.cs
- PerformanceCounterPermissionEntry.cs
- ContainerFilterService.cs
- EventsTab.cs
- Facet.cs
- DesignerForm.cs
- SingleResultAttribute.cs
- SpecialFolderEnumConverter.cs
- SafeEventLogReadHandle.cs
- FrameSecurityDescriptor.cs
- WebPartVerb.cs
- TdsParserHelperClasses.cs
- IsolatedStorageException.cs
- DeferredReference.cs
- IArgumentProvider.cs
- PermissionSetTriple.cs
- FactoryRecord.cs
- QilTernary.cs
- MouseGestureValueSerializer.cs
- ResourcePool.cs
- PrintControllerWithStatusDialog.cs
- RepeatBehavior.cs
- ColorContext.cs
- RuntimeHandles.cs
- ping.cs
- MethodBuilderInstantiation.cs
- InfocardExtendedInformationEntry.cs
- InternalDispatchObject.cs
- SocketInformation.cs
- SegmentTree.cs
- ToggleButtonAutomationPeer.cs
- XmlSchemaComplexContent.cs
- ProcessingInstructionAction.cs
- SamlAttributeStatement.cs
- RegistryKey.cs
- DoubleConverter.cs
- Light.cs
- WebPermission.cs
- DataListCommandEventArgs.cs
- SqlUDTStorage.cs