Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- CodeLinePragma.cs
- WizardStepBase.cs
- XsltConvert.cs
- InfoCardTraceRecord.cs
- WindowsMenu.cs
- NameValueSectionHandler.cs
- ClickablePoint.cs
- PropertyGridEditorPart.cs
- TypedLocationWrapper.cs
- TrustSection.cs
- LocalFileSettingsProvider.cs
- StreamAsIStream.cs
- DbModificationClause.cs
- DelegateSerializationHolder.cs
- XmlSchemaCollection.cs
- RowSpanVector.cs
- CompilerScopeManager.cs
- PropertyDescriptorGridEntry.cs
- X509Certificate.cs
- UrlPath.cs
- DataGridItem.cs
- Type.cs
- CultureInfoConverter.cs
- FormParameter.cs
- columnmapfactory.cs
- IgnorePropertiesAttribute.cs
- FixedSOMFixedBlock.cs
- ComponentResourceKeyConverter.cs
- JournalEntryStack.cs
- ReadingWritingEntityEventArgs.cs
- PenContexts.cs
- TextServicesLoader.cs
- ExpressionConverter.cs
- UntypedNullExpression.cs
- DetailsViewModeEventArgs.cs
- SequenceNumber.cs
- DrawListViewColumnHeaderEventArgs.cs
- StructuredTypeInfo.cs
- CacheAxisQuery.cs
- TableItemPattern.cs
- SchemaImporterExtensionsSection.cs
- EntityDataSourceColumn.cs
- DoWorkEventArgs.cs
- Sorting.cs
- QilPatternFactory.cs
- MessageDesigner.cs
- BinHexDecoder.cs
- BypassElement.cs
- XmlLanguage.cs
- TreeView.cs
- ChildrenQuery.cs
- WindowsStatusBar.cs
- TriState.cs
- DynamicResourceExtensionConverter.cs
- ConfigurationStrings.cs
- EdmValidator.cs
- TextRangeSerialization.cs
- ObjectDataSourceStatusEventArgs.cs
- DbProviderFactories.cs
- WebPartVerb.cs
- XmlBaseReader.cs
- CreateUserWizardStep.cs
- MemberJoinTreeNode.cs
- XamlPathDataSerializer.cs
- EdmFunction.cs
- CustomSignedXml.cs
- Scheduling.cs
- SafeProcessHandle.cs
- CrossSiteScriptingValidation.cs
- DataGridColumn.cs
- TextEditorDragDrop.cs
- backend.cs
- AuthenticateEventArgs.cs
- EntityContainer.cs
- SmiConnection.cs
- RightsManagementPermission.cs
- BuildResult.cs
- StringResourceManager.cs
- RegexWriter.cs
- SchemaNamespaceManager.cs
- ListBindingHelper.cs
- CompositeControl.cs
- TextElement.cs
- SessionStateItemCollection.cs
- _NegoState.cs
- PathHelper.cs
- WebBrowserProgressChangedEventHandler.cs
- ButtonBaseDesigner.cs
- AdRotator.cs
- StreamReader.cs
- RolePrincipal.cs
- HMAC.cs
- Translator.cs
- EdmFunction.cs
- ExpandSegmentCollection.cs
- Tuple.cs
- SqlClientMetaDataCollectionNames.cs
- SqlCacheDependencySection.cs
- XmlNamedNodeMap.cs
- DiscoveryInnerClientAdhoc11.cs