Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / QueryContinueDragEventArgs.cs / 1305600 / 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
- UnmanagedMarshal.cs
- Cursors.cs
- InvalidOleVariantTypeException.cs
- DataSetSchema.cs
- HttpModuleAction.cs
- ConfigurationManagerInternal.cs
- CqlLexerHelpers.cs
- HandlerBase.cs
- XmlValidatingReaderImpl.cs
- XsdCachingReader.cs
- oledbmetadatacolumnnames.cs
- TypeSystem.cs
- ACE.cs
- XmlSchemaSimpleContent.cs
- ParameterCollection.cs
- CannotUnloadAppDomainException.cs
- LocatorBase.cs
- XmlSchemaSimpleType.cs
- ListChangedEventArgs.cs
- Queue.cs
- CompModSwitches.cs
- StylusDevice.cs
- CqlErrorHelper.cs
- ClientSponsor.cs
- TextEditorMouse.cs
- ServiceThrottlingBehavior.cs
- IntPtr.cs
- EventLogEntryCollection.cs
- InvokeCompletedEventArgs.cs
- OleDbSchemaGuid.cs
- LayoutEvent.cs
- SqlVisitor.cs
- HttpPostLocalhostServerProtocol.cs
- Activity.cs
- XmlSchemaSet.cs
- AddInActivator.cs
- ClientFormsIdentity.cs
- PreviewKeyDownEventArgs.cs
- PiiTraceSource.cs
- ExceptionRoutedEventArgs.cs
- Int32AnimationUsingKeyFrames.cs
- WebPartEditorApplyVerb.cs
- Parameter.cs
- RelatedImageListAttribute.cs
- HttpFileCollectionWrapper.cs
- FactoryGenerator.cs
- SqlGatherProducedAliases.cs
- ZipIOZip64EndOfCentralDirectoryBlock.cs
- RandomNumberGenerator.cs
- PrintingPermissionAttribute.cs
- Char.cs
- RegexInterpreter.cs
- CompilationLock.cs
- PenCursorManager.cs
- QueryServiceConfigHandle.cs
- SoapConverter.cs
- DataSourceDescriptorCollection.cs
- MultipleViewPattern.cs
- Claim.cs
- DrawListViewColumnHeaderEventArgs.cs
- ChannelPoolSettingsElement.cs
- SystemIPv6InterfaceProperties.cs
- CellTreeNodeVisitors.cs
- ToolStripOverflow.cs
- WebPartPersonalization.cs
- PerfProviderCollection.cs
- AbstractSvcMapFileLoader.cs
- RenderTargetBitmap.cs
- SR.cs
- SafeLibraryHandle.cs
- HTMLTagNameToTypeMapper.cs
- TogglePattern.cs
- DataServiceProviderMethods.cs
- PocoPropertyAccessorStrategy.cs
- DisableDpiAwarenessAttribute.cs
- AssemblyResourceLoader.cs
- ASCIIEncoding.cs
- StorageMappingItemLoader.cs
- HierarchicalDataSourceControl.cs
- Monitor.cs
- ResourceIDHelper.cs
- DataServiceContext.cs
- XmlSchemaCollection.cs
- IndentedWriter.cs
- Int16Animation.cs
- RtfToken.cs
- ItemsChangedEventArgs.cs
- ObjectNotFoundException.cs
- WebBrowsableAttribute.cs
- DeferredSelectedIndexReference.cs
- InputMethod.cs
- SqlUdtInfo.cs
- DbProviderSpecificTypePropertyAttribute.cs
- FamilyMapCollection.cs
- MouseButton.cs
- CustomWebEventKey.cs
- CustomCategoryAttribute.cs
- TimeoutValidationAttribute.cs
- XmlMemberMapping.cs
- Vars.cs