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
- HttpCacheParams.cs
- ProxyManager.cs
- SizeConverter.cs
- TextViewDesigner.cs
- LineSegment.cs
- basecomparevalidator.cs
- TileModeValidation.cs
- LocalTransaction.cs
- TypeUtils.cs
- PageCodeDomTreeGenerator.cs
- FrameAutomationPeer.cs
- BlockExpression.cs
- LicFileLicenseProvider.cs
- TypeConverterHelper.cs
- DesignerTransactionCloseEvent.cs
- Page.cs
- Funcletizer.cs
- Activity.cs
- XslTransformFileEditor.cs
- COM2IVsPerPropertyBrowsingHandler.cs
- XPathAncestorQuery.cs
- URLMembershipCondition.cs
- PersonalizationProviderCollection.cs
- SectionVisual.cs
- FilteredDataSetHelper.cs
- IgnoreFileBuildProvider.cs
- GroupDescription.cs
- Region.cs
- SchemaCollectionCompiler.cs
- SqlDependencyListener.cs
- StreamingContext.cs
- StrongName.cs
- UTF7Encoding.cs
- HandleCollector.cs
- GlyphShapingProperties.cs
- WindowsGrip.cs
- UnitySerializationHolder.cs
- ConnectionOrientedTransportManager.cs
- TextureBrush.cs
- InvalidCommandTreeException.cs
- BuildResultCache.cs
- CounterSampleCalculator.cs
- NetNamedPipeSecurityElement.cs
- BinaryKeyIdentifierClause.cs
- PointUtil.cs
- DataGridViewImageColumn.cs
- ConcurrencyMode.cs
- StylusPointCollection.cs
- Int32Animation.cs
- BehaviorEditorPart.cs
- XamlHttpHandlerFactory.cs
- IIS7UserPrincipal.cs
- PathFigure.cs
- WebConfigurationManager.cs
- SoapSchemaMember.cs
- Socket.cs
- MsmqAppDomainProtocolHandler.cs
- xsdvalidator.cs
- CustomPopupPlacement.cs
- documentsequencetextview.cs
- DaylightTime.cs
- CompiledAction.cs
- sqlstateclientmanager.cs
- DynamicDataExtensions.cs
- smtpconnection.cs
- IgnorePropertiesAttribute.cs
- TriggerBase.cs
- LabelAutomationPeer.cs
- NameSpaceExtractor.cs
- DocumentScope.cs
- AnnotationComponentChooser.cs
- DynamicUpdateCommand.cs
- CaseInsensitiveOrdinalStringComparer.cs
- GridViewDeleteEventArgs.cs
- XsltQilFactory.cs
- ProcessInputEventArgs.cs
- InputScopeAttribute.cs
- DataControlFieldTypeEditor.cs
- StringSource.cs
- Quad.cs
- ButtonFlatAdapter.cs
- AccessDataSourceView.cs
- CalendarAutoFormat.cs
- Function.cs
- OverflowException.cs
- UInt16Converter.cs
- WmpBitmapDecoder.cs
- DefaultValueTypeConverter.cs
- XmlNavigatorStack.cs
- ImageMetadata.cs
- login.cs
- RegexCode.cs
- ElementProxy.cs
- ProcessHostServerConfig.cs
- UIntPtr.cs
- TextStore.cs
- ScriptResourceHandler.cs
- NativeMethods.cs
- FormViewDeleteEventArgs.cs
- InternalConfigRoot.cs