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
- SeverityFilter.cs
- GeneralTransform3DTo2DTo3D.cs
- TextEditor.cs
- MetaTable.cs
- RegexMatchCollection.cs
- SymbolMethod.cs
- ThicknessConverter.cs
- DataGridViewComboBoxColumn.cs
- DataServiceExpressionVisitor.cs
- RuleProcessor.cs
- ObjectIDGenerator.cs
- RestClientProxyHandler.cs
- HttpDebugHandler.cs
- EntityViewGenerator.cs
- DependencyStoreSurrogate.cs
- control.ime.cs
- EntityDataReader.cs
- CustomMenuItemCollection.cs
- FixedSOMPageElement.cs
- ForEachAction.cs
- XmlSchemaAttributeGroupRef.cs
- TreeNode.cs
- StrokeIntersection.cs
- MetaModel.cs
- DataGridViewColumnTypeEditor.cs
- NestedContainer.cs
- WindowsListView.cs
- IFlowDocumentViewer.cs
- XhtmlTextWriter.cs
- Unit.cs
- TypeHelper.cs
- HandleCollector.cs
- Point3DCollectionValueSerializer.cs
- Binding.cs
- OneOfElement.cs
- SendSecurityHeader.cs
- ForEachAction.cs
- GrammarBuilderPhrase.cs
- DbProviderServices.cs
- SupportsEventValidationAttribute.cs
- DragEvent.cs
- _ProxyChain.cs
- ControlPersister.cs
- ButtonRenderer.cs
- IndexedString.cs
- MenuBase.cs
- StyleCollection.cs
- TemplateBamlTreeBuilder.cs
- ParseNumbers.cs
- BaseTemplateCodeDomTreeGenerator.cs
- PlanCompiler.cs
- XmlCompatibilityReader.cs
- ConnectionStringsSection.cs
- MultiDataTrigger.cs
- RemoteWebConfigurationHostServer.cs
- DataStorage.cs
- SpeechSeg.cs
- FakeModelPropertyImpl.cs
- embossbitmapeffect.cs
- Rectangle.cs
- DesignerActionListCollection.cs
- MergeLocalizationDirectives.cs
- WorkflowViewManager.cs
- ClientSettingsProvider.cs
- DynamicUpdateCommand.cs
- EventRecord.cs
- MarkupCompilePass1.cs
- rsa.cs
- MouseActionValueSerializer.cs
- ContractType.cs
- DynamicDataRoute.cs
- Switch.cs
- TransformerTypeCollection.cs
- NonSerializedAttribute.cs
- IdlingCommunicationPool.cs
- DSASignatureDeformatter.cs
- PeerNodeTraceRecord.cs
- CanExecuteRoutedEventArgs.cs
- ContentFilePart.cs
- RegexBoyerMoore.cs
- SpecialFolderEnumConverter.cs
- EventLogPermissionAttribute.cs
- TabletCollection.cs
- ReliableChannelBinder.cs
- NetworkInformationPermission.cs
- Pair.cs
- ObjectSpanRewriter.cs
- QilXmlWriter.cs
- ToolBar.cs
- UTF7Encoding.cs
- BoolExpressionVisitors.cs
- CompilerParameters.cs
- processwaithandle.cs
- HttpRuntimeSection.cs
- CatalogPart.cs
- WhiteSpaceTrimStringConverter.cs
- AddingNewEventArgs.cs
- TrackingMemoryStream.cs
- XpsS0ValidatingLoader.cs
- TargetControlTypeAttribute.cs