Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / QueryContinueDragEventArgs.cs / 1 / QueryContinueDragEventArgs.cs
//---------------------------------------------------------------------------- // // File: QueryContinueDragEventArgs.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: QueryContinueDragEventArgs for drag-and-drop operation. // // History: // 08/19/2004 : sangilj Created // //--------------------------------------------------------------------------- using System; using System.Diagnostics; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows { ////// The QueryContinueDragEventArgs class represents a type of RoutedEventArgs that /// are relevant to QueryContinueDrag event. /// public sealed class QueryContinueDragEventArgs : RoutedEventArgs { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Initializes a new instance of the QueryContinueDragEventArgs class. /// /// /// Escape key was pressed. /// /// /// Input states. /// internal QueryContinueDragEventArgs(bool escapePressed, DragDropKeyStates dragDropKeyStates) { if (!DragDrop.IsValidDragDropKeyStates(dragDropKeyStates)) { Debug.Assert(false, "Invalid dragDropKeyStates"); } this._escapePressed = escapePressed; this._dragDropKeyStates = dragDropKeyStates; } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Escape key was pressed. /// public bool EscapePressed { get { return _escapePressed; } } ////// The DragDropKeyStates that indicates the current states for /// physical keyboard keys and mouse buttons. /// public DragDropKeyStates KeyStates { get {return _dragDropKeyStates;} } ////// The action of drag operation /// public DragAction Action { get { return _action; } set { if (!DragDrop.IsValidDragAction(value)) { throw new ArgumentException(SR.Get(SRID.DragDrop_DragActionInvalid, "value")); } _action = value; } } #endregion Public Methods #region Protected Methods //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ ////// The mechanism used to call the type-specific handler on the target. /// /// /// The generic handler to call in a type-specific way. /// /// /// The target to call the handler on. /// protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { QueryContinueDragEventHandler handler = (QueryContinueDragEventHandler)genericHandler; handler(genericTarget, this); } #endregion Protected Methods //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private bool _escapePressed; private DragDropKeyStates _dragDropKeyStates; private DragAction _action; #endregion Private Fields } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // // File: QueryContinueDragEventArgs.cs // // Copyright (C) Microsoft Corporation. All rights reserved. // // Description: QueryContinueDragEventArgs for drag-and-drop operation. // // History: // 08/19/2004 : sangilj Created // //--------------------------------------------------------------------------- using System; using System.Diagnostics; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows { ////// The QueryContinueDragEventArgs class represents a type of RoutedEventArgs that /// are relevant to QueryContinueDrag event. /// public sealed class QueryContinueDragEventArgs : RoutedEventArgs { //----------------------------------------------------- // // Constructors // //----------------------------------------------------- #region Constructors ////// Initializes a new instance of the QueryContinueDragEventArgs class. /// /// /// Escape key was pressed. /// /// /// Input states. /// internal QueryContinueDragEventArgs(bool escapePressed, DragDropKeyStates dragDropKeyStates) { if (!DragDrop.IsValidDragDropKeyStates(dragDropKeyStates)) { Debug.Assert(false, "Invalid dragDropKeyStates"); } this._escapePressed = escapePressed; this._dragDropKeyStates = dragDropKeyStates; } #endregion Constructors //------------------------------------------------------ // // Public Methods // //----------------------------------------------------- #region Public Methods ////// Escape key was pressed. /// public bool EscapePressed { get { return _escapePressed; } } ////// The DragDropKeyStates that indicates the current states for /// physical keyboard keys and mouse buttons. /// public DragDropKeyStates KeyStates { get {return _dragDropKeyStates;} } ////// The action of drag operation /// public DragAction Action { get { return _action; } set { if (!DragDrop.IsValidDragAction(value)) { throw new ArgumentException(SR.Get(SRID.DragDrop_DragActionInvalid, "value")); } _action = value; } } #endregion Public Methods #region Protected Methods //------------------------------------------------------ // // Protected Methods // //------------------------------------------------------ ////// The mechanism used to call the type-specific handler on the target. /// /// /// The generic handler to call in a type-specific way. /// /// /// The target to call the handler on. /// protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget) { QueryContinueDragEventHandler handler = (QueryContinueDragEventHandler)genericHandler; handler(genericTarget, this); } #endregion Protected Methods //----------------------------------------------------- // // Private Fields // //------------------------------------------------------ #region Private Fields private bool _escapePressed; private DragDropKeyStates _dragDropKeyStates; private DragAction _action; #endregion Private Fields } } // 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
- UnorderedHashRepartitionStream.cs
- AsyncResult.cs
- DependentTransaction.cs
- TableProviderWrapper.cs
- OracleConnectionString.cs
- ObjectParameterCollection.cs
- XmlUtilWriter.cs
- PerfCounters.cs
- VirtualizedContainerService.cs
- TreeBuilderBamlTranslator.cs
- RadioButton.cs
- ChildTable.cs
- ToolBarButtonClickEvent.cs
- Panel.cs
- SqlServer2KCompatibilityAnnotation.cs
- MediaTimeline.cs
- FileDetails.cs
- Stream.cs
- LogLogRecordHeader.cs
- NumericUpDownAcceleration.cs
- SignatureToken.cs
- HtmlMeta.cs
- LiteralTextContainerControlBuilder.cs
- ContextMarshalException.cs
- OrderPreservingPipeliningSpoolingTask.cs
- RelatedView.cs
- DynamicDocumentPaginator.cs
- ListBox.cs
- RootBrowserWindowProxy.cs
- TransformValueSerializer.cs
- X509Extension.cs
- HeaderedContentControl.cs
- DataGridTablesFactory.cs
- SpeechUI.cs
- SoapReflectionImporter.cs
- ContractHandle.cs
- WindowsRegion.cs
- ItemsControlAutomationPeer.cs
- SelectionEditor.cs
- EventListenerClientSide.cs
- QuaternionRotation3D.cs
- Polygon.cs
- Span.cs
- VirtualPath.cs
- RuntimeHelpers.cs
- ScopeCompiler.cs
- TypeUsage.cs
- IUnknownConstantAttribute.cs
- StateMachineSubscription.cs
- IteratorDescriptor.cs
- DataGridCellItemAutomationPeer.cs
- StdValidatorsAndConverters.cs
- BasePropertyDescriptor.cs
- XmlILOptimizerVisitor.cs
- ComponentCollection.cs
- PublishLicense.cs
- TextServicesLoader.cs
- SelectorItemAutomationPeer.cs
- DateTimeOffsetStorage.cs
- SafeMILHandle.cs
- ProgressBarHighlightConverter.cs
- Tile.cs
- DoubleCollection.cs
- FieldToken.cs
- DbConnectionInternal.cs
- StandardToolWindows.cs
- DataContractSerializer.cs
- XmlSchemaSimpleContentExtension.cs
- HttpModulesSection.cs
- DataRowView.cs
- SqlDataSourceView.cs
- PasswordTextNavigator.cs
- ComboBox.cs
- ImmutableDispatchRuntime.cs
- DynamicResourceExtension.cs
- ObjectToIdCache.cs
- HtmlInputHidden.cs
- ByteConverter.cs
- CalendarModeChangedEventArgs.cs
- ControlParameter.cs
- SQLStringStorage.cs
- MenuCommandService.cs
- XsdDuration.cs
- DataGridViewLinkCell.cs
- HtmlLiteralTextAdapter.cs
- ProfileSection.cs
- ColumnCollection.cs
- QueueProcessor.cs
- HighlightVisual.cs
- ContextDataSourceContextData.cs
- EntityTemplateFactory.cs
- LineServices.cs
- EntityDataSourceView.cs
- FixedSOMLineRanges.cs
- GroupPartitionExpr.cs
- Comparer.cs
- XmlElementElementCollection.cs
- CursorInteropHelper.cs
- InvalidEnumArgumentException.cs
- TrustLevelCollection.cs