Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / 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
- NavigationProperty.cs
- XamlParser.cs
- DynamicILGenerator.cs
- VerificationAttribute.cs
- Triangle.cs
- AccessDataSourceView.cs
- FutureFactory.cs
- VarRefManager.cs
- TreeNodeMouseHoverEvent.cs
- Grid.cs
- XPathScanner.cs
- ImagingCache.cs
- DateTimeConverter2.cs
- SetIterators.cs
- Function.cs
- SpellCheck.cs
- OleDbFactory.cs
- ReliableChannelListener.cs
- SmtpLoginAuthenticationModule.cs
- EdmRelationshipRoleAttribute.cs
- ArgumentException.cs
- CursorInteropHelper.cs
- Pair.cs
- ObservableCollection.cs
- Compiler.cs
- ZoneButton.cs
- ColumnCollection.cs
- WsdlInspector.cs
- XmlSchemaProviderAttribute.cs
- ConfigurationManagerInternalFactory.cs
- WeakReferenceList.cs
- DataGridTextBoxColumn.cs
- OwnerDrawPropertyBag.cs
- SQLBoolean.cs
- FamilyCollection.cs
- BitmapCodecInfo.cs
- DebugHandleTracker.cs
- HttpCookieCollection.cs
- clipboard.cs
- GenericTextProperties.cs
- Select.cs
- NotImplementedException.cs
- EntityWrapper.cs
- ProviderConnectionPoint.cs
- DocumentPaginator.cs
- MatrixConverter.cs
- ContentHostHelper.cs
- EntitySqlException.cs
- GridViewColumnHeader.cs
- GeometryConverter.cs
- ListViewItemCollectionEditor.cs
- DataGridRelationshipRow.cs
- Token.cs
- XmlAttributeProperties.cs
- WsdlInspector.cs
- WindowsMenu.cs
- LocatorPart.cs
- PtsPage.cs
- ByteStorage.cs
- XmlTextEncoder.cs
- ArcSegment.cs
- WebConfigurationHost.cs
- RepeaterItemEventArgs.cs
- Queue.cs
- ProjectedSlot.cs
- EventMetadata.cs
- CacheDependency.cs
- PageStatePersister.cs
- ArrayMergeHelper.cs
- PipelineDeploymentState.cs
- DateTimeEditor.cs
- COM2ExtendedBrowsingHandler.cs
- ItemContainerGenerator.cs
- MSAAWinEventWrap.cs
- ScriptComponentDescriptor.cs
- RawStylusSystemGestureInputReport.cs
- NestedContainer.cs
- TrustManagerMoreInformation.cs
- SEHException.cs
- WebDisplayNameAttribute.cs
- ColumnTypeConverter.cs
- ExceptionValidationRule.cs
- ObjectDataSourceSelectingEventArgs.cs
- CodeDesigner.cs
- WebBrowserNavigatingEventHandler.cs
- FixUpCollection.cs
- X509ChainElement.cs
- DeobfuscatingStream.cs
- PeerNameResolver.cs
- WebControlParameterProxy.cs
- PersonalizationProviderCollection.cs
- IERequestCache.cs
- BitmapEffect.cs
- SpellerHighlightLayer.cs
- GeneralTransform3DCollection.cs
- Formatter.cs
- SqlExpressionNullability.cs
- Container.cs
- Container.cs
- MarshalDirectiveException.cs