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
- EqualityComparer.cs
- SelectionRangeConverter.cs
- CaseStatementSlot.cs
- PropertyRecord.cs
- TransactionFlowOption.cs
- ICspAsymmetricAlgorithm.cs
- Cursor.cs
- Compiler.cs
- PeerResolverElement.cs
- ZipIOExtraField.cs
- reliableinputsessionchannel.cs
- QualificationDataItem.cs
- MetabaseSettings.cs
- FormClosingEvent.cs
- CreateUserWizardAutoFormat.cs
- ClassImporter.cs
- CustomActivityDesigner.cs
- BamlResourceDeserializer.cs
- TransportManager.cs
- SqlPersonalizationProvider.cs
- CqlIdentifiers.cs
- RowCache.cs
- ArraySet.cs
- BindingWorker.cs
- XamlFrame.cs
- RsaKeyIdentifierClause.cs
- GenericWebPart.cs
- ThemeInfoAttribute.cs
- Pool.cs
- HostedNamedPipeTransportManager.cs
- WebEventCodes.cs
- HtmlShim.cs
- TextReader.cs
- UpdateTranslator.cs
- XsltCompileContext.cs
- SecureUICommand.cs
- UTF32Encoding.cs
- DuplicateWaitObjectException.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ResourceAttributes.cs
- XsdDuration.cs
- DispatcherObject.cs
- MenuItemBinding.cs
- XappLauncher.cs
- WebConfigurationFileMap.cs
- IntegerFacetDescriptionElement.cs
- CheckableControlBaseAdapter.cs
- TableLayoutCellPaintEventArgs.cs
- OutputCacheProfileCollection.cs
- XmlNodeReader.cs
- DodSequenceMerge.cs
- TransactionFilter.cs
- OleDbReferenceCollection.cs
- Point3DCollectionConverter.cs
- AdapterUtil.cs
- ConfigXmlSignificantWhitespace.cs
- SmtpException.cs
- _emptywebproxy.cs
- CombinedGeometry.cs
- CookieProtection.cs
- DynamicFilterExpression.cs
- InputScope.cs
- HtmlPageAdapter.cs
- UDPClient.cs
- InputBuffer.cs
- ObjectListShowCommandsEventArgs.cs
- SystemParameters.cs
- XmlSchemaSimpleContentExtension.cs
- LocalizableAttribute.cs
- PropertyChangedEventArgs.cs
- TextMarkerSource.cs
- MessagePropertyVariants.cs
- ItemContainerGenerator.cs
- ContextDataSourceView.cs
- MsmqIntegrationChannelListener.cs
- QilParameter.cs
- httpapplicationstate.cs
- VariableExpressionConverter.cs
- CreationContext.cs
- ResumeStoryboard.cs
- ThumbAutomationPeer.cs
- XmlSchemaSequence.cs
- WorkflowMarkupSerializerMapping.cs
- ToolStripLabel.cs
- StaticTextPointer.cs
- ObjectQueryExecutionPlan.cs
- PointF.cs
- XPathExpr.cs
- RegexMatchCollection.cs
- ToolStripComboBox.cs
- MachineKeyConverter.cs
- XmlSchemas.cs
- Module.cs
- FormViewInsertEventArgs.cs
- XamlStream.cs
- Monitor.cs
- MeasurementDCInfo.cs
- PiiTraceSource.cs
- SafeThreadHandle.cs
- CustomLineCap.cs