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 / Input / RawMouseInputReport.cs / 1 / RawMouseInputReport.cs
using System.Windows.Media; //
using System.Security;
using System.Security.Permissions;
using MS.Internal;
using MS.Internal.PresentationCore;
using MS.Win32;
using System;
namespace System.Windows.Input
{
///
/// The RawMouseInputReport class encapsulates the raw input provided
/// from a mouse.
///
///
/// It is important to note that the InputReport class only contains
/// blittable types. This is required so that the report can be
/// marshalled across application domains.
///
[FriendAccessAllowed]
internal class RawMouseInputReport : InputReport
{
///
/// Constructs ad instance of the RawMouseInputReport class.
///
///
/// The mode in which the input is being provided.
///
///
/// The time when the input occured.
///
///
/// The PresentationSource over which the mouse is moved.
///
///
/// The set of actions being reported.
///
///
/// If horizontal position being reported.
///
///
/// If vertical position being reported.
///
///
/// If wheel delta being reported.
///
///
/// Any extra information being provided along with the input.
///
///
/// Critical:This handles critical data in the form of PresentationSource and ExtraInformation
/// TreatAsSafe:There are demands on the critical data(PresentationSource/ExtraInformation)
///
[SecurityCritical, SecurityTreatAsSafe]
public RawMouseInputReport(
InputMode mode,
int timestamp,
PresentationSource inputSource,
RawMouseActions actions,
int x,
int y,
int wheel,
IntPtr extraInformation) : base(inputSource, InputType.Mouse, mode, timestamp)
{
if (!IsValidRawMouseActions(actions))
throw new System.ComponentModel.InvalidEnumArgumentException("actions", (int)actions, typeof(RawMouseActions));
/* we pass a null state from MouseDevice.PreProcessorInput, so null is valid value for state */
_actions = actions;
_x = x;
_y = y;
_wheel = wheel;
_extraInformation = new SecurityCriticalData(extraInformation);
}
///
/// Read-only access to the set of actions that were reported.
///
public RawMouseActions Actions {get {return _actions;}}
///
/// Read-only access to the horizontal position that was reported.
///
public int X {get {return _x;}}
///
/// Read-only access to the vertical position that was reported.
///
public int Y {get {return _y;}}
///
/// Read-only access to the wheel delta that was reported.
///
public int Wheel {get {return _wheel;}}
///
/// Read-only access to the extra information was provided along
/// with the input.
///
///
/// Critical: This data was got under an elevation. There exists a link demand to
/// block access. The critical exists to catch new callers too.
///
public IntPtr ExtraInformation
{
[SecurityCritical]
get
{
return _extraInformation.Value;
}
}
// IsValid Method for RawMouseActions. Relies on the enum being flags.
internal static bool IsValidRawMouseActions(RawMouseActions actions)
{
if (actions == RawMouseActions.None)
return true;
if ((( RawMouseActions.AttributesChanged | RawMouseActions.Activate | RawMouseActions.Deactivate |
RawMouseActions.RelativeMove | RawMouseActions.AbsoluteMove | RawMouseActions.VirtualDesktopMove |
RawMouseActions.Button1Press | RawMouseActions.Button1Release |
RawMouseActions.Button2Press | RawMouseActions.Button2Release |
RawMouseActions.Button3Press | RawMouseActions.Button3Release |
RawMouseActions.Button4Press | RawMouseActions.Button4Release |
RawMouseActions.Button5Press | RawMouseActions.Button5Release |
RawMouseActions.VerticalWheelRotate | RawMouseActions.HorizontalWheelRotate |
RawMouseActions.CancelCapture |
RawMouseActions.QueryCursor) & actions) == actions)
{
if (!(((RawMouseActions.Deactivate & actions) == actions && RawMouseActions.Deactivate != actions ) ||
(((RawMouseActions.Button1Press | RawMouseActions.Button1Release) & actions) == (RawMouseActions.Button1Press | RawMouseActions.Button1Release)) ||
(((RawMouseActions.Button2Press | RawMouseActions.Button2Release) & actions) == (RawMouseActions.Button2Press | RawMouseActions.Button2Release)) ||
(((RawMouseActions.Button3Press | RawMouseActions.Button3Release) & actions) == (RawMouseActions.Button3Press | RawMouseActions.Button3Release)) ||
(((RawMouseActions.Button4Press | RawMouseActions.Button4Release) & actions) == (RawMouseActions.Button4Press | RawMouseActions.Button4Release)) ||
(((RawMouseActions.Button5Press | RawMouseActions.Button5Release) & actions) == (RawMouseActions.Button5Press | RawMouseActions.Button5Release))))
{
return true;
}
}
return false;
}
private RawMouseActions _actions;
private int _x;
private int _y;
private int _wheel;
internal bool _isSynchronize; // Set from MouseDevice.Synchronize.
///
/// Critical:This data was got under an elevation and is not safe to expose.
///
private SecurityCriticalData _extraInformation;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System.Windows.Media; //
using System.Security;
using System.Security.Permissions;
using MS.Internal;
using MS.Internal.PresentationCore;
using MS.Win32;
using System;
namespace System.Windows.Input
{
///
/// The RawMouseInputReport class encapsulates the raw input provided
/// from a mouse.
///
///
/// It is important to note that the InputReport class only contains
/// blittable types. This is required so that the report can be
/// marshalled across application domains.
///
[FriendAccessAllowed]
internal class RawMouseInputReport : InputReport
{
///
/// Constructs ad instance of the RawMouseInputReport class.
///
///
/// The mode in which the input is being provided.
///
///
/// The time when the input occured.
///
///
/// The PresentationSource over which the mouse is moved.
///
///
/// The set of actions being reported.
///
///
/// If horizontal position being reported.
///
///
/// If vertical position being reported.
///
///
/// If wheel delta being reported.
///
///
/// Any extra information being provided along with the input.
///
///
/// Critical:This handles critical data in the form of PresentationSource and ExtraInformation
/// TreatAsSafe:There are demands on the critical data(PresentationSource/ExtraInformation)
///
[SecurityCritical, SecurityTreatAsSafe]
public RawMouseInputReport(
InputMode mode,
int timestamp,
PresentationSource inputSource,
RawMouseActions actions,
int x,
int y,
int wheel,
IntPtr extraInformation) : base(inputSource, InputType.Mouse, mode, timestamp)
{
if (!IsValidRawMouseActions(actions))
throw new System.ComponentModel.InvalidEnumArgumentException("actions", (int)actions, typeof(RawMouseActions));
/* we pass a null state from MouseDevice.PreProcessorInput, so null is valid value for state */
_actions = actions;
_x = x;
_y = y;
_wheel = wheel;
_extraInformation = new SecurityCriticalData(extraInformation);
}
///
/// Read-only access to the set of actions that were reported.
///
public RawMouseActions Actions {get {return _actions;}}
///
/// Read-only access to the horizontal position that was reported.
///
public int X {get {return _x;}}
///
/// Read-only access to the vertical position that was reported.
///
public int Y {get {return _y;}}
///
/// Read-only access to the wheel delta that was reported.
///
public int Wheel {get {return _wheel;}}
///
/// Read-only access to the extra information was provided along
/// with the input.
///
///
/// Critical: This data was got under an elevation. There exists a link demand to
/// block access. The critical exists to catch new callers too.
///
public IntPtr ExtraInformation
{
[SecurityCritical]
get
{
return _extraInformation.Value;
}
}
// IsValid Method for RawMouseActions. Relies on the enum being flags.
internal static bool IsValidRawMouseActions(RawMouseActions actions)
{
if (actions == RawMouseActions.None)
return true;
if ((( RawMouseActions.AttributesChanged | RawMouseActions.Activate | RawMouseActions.Deactivate |
RawMouseActions.RelativeMove | RawMouseActions.AbsoluteMove | RawMouseActions.VirtualDesktopMove |
RawMouseActions.Button1Press | RawMouseActions.Button1Release |
RawMouseActions.Button2Press | RawMouseActions.Button2Release |
RawMouseActions.Button3Press | RawMouseActions.Button3Release |
RawMouseActions.Button4Press | RawMouseActions.Button4Release |
RawMouseActions.Button5Press | RawMouseActions.Button5Release |
RawMouseActions.VerticalWheelRotate | RawMouseActions.HorizontalWheelRotate |
RawMouseActions.CancelCapture |
RawMouseActions.QueryCursor) & actions) == actions)
{
if (!(((RawMouseActions.Deactivate & actions) == actions && RawMouseActions.Deactivate != actions ) ||
(((RawMouseActions.Button1Press | RawMouseActions.Button1Release) & actions) == (RawMouseActions.Button1Press | RawMouseActions.Button1Release)) ||
(((RawMouseActions.Button2Press | RawMouseActions.Button2Release) & actions) == (RawMouseActions.Button2Press | RawMouseActions.Button2Release)) ||
(((RawMouseActions.Button3Press | RawMouseActions.Button3Release) & actions) == (RawMouseActions.Button3Press | RawMouseActions.Button3Release)) ||
(((RawMouseActions.Button4Press | RawMouseActions.Button4Release) & actions) == (RawMouseActions.Button4Press | RawMouseActions.Button4Release)) ||
(((RawMouseActions.Button5Press | RawMouseActions.Button5Release) & actions) == (RawMouseActions.Button5Press | RawMouseActions.Button5Release))))
{
return true;
}
}
return false;
}
private RawMouseActions _actions;
private int _x;
private int _y;
private int _wheel;
internal bool _isSynchronize; // Set from MouseDevice.Synchronize.
///
/// Critical:This data was got under an elevation and is not safe to expose.
///
private SecurityCriticalData _extraInformation;
}
}
// 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
- UIElement3DAutomationPeer.cs
- BinaryNode.cs
- BinaryObjectInfo.cs
- SetIterators.cs
- ClientSideProviderDescription.cs
- PageClientProxyGenerator.cs
- XmlWriterDelegator.cs
- HttpHeaderCollection.cs
- ApplicationFileParser.cs
- ProcessRequestAsyncResult.cs
- BaseAsyncResult.cs
- StyleCollection.cs
- BaseProcessor.cs
- Font.cs
- XmlNamespaceManager.cs
- ClientSideQueueItem.cs
- RawStylusInputReport.cs
- SystemColorTracker.cs
- TCPListener.cs
- UiaCoreApi.cs
- httpapplicationstate.cs
- ConstraintCollection.cs
- Error.cs
- ControlsConfig.cs
- HandlerMappingMemo.cs
- COM2EnumConverter.cs
- WeakReferenceKey.cs
- TextLineResult.cs
- HostnameComparisonMode.cs
- TemplateXamlParser.cs
- MouseDevice.cs
- Win32Native.cs
- NativeMethods.cs
- StrokeRenderer.cs
- RecordConverter.cs
- diagnosticsswitches.cs
- SiteIdentityPermission.cs
- ContentOperations.cs
- WindowsPen.cs
- TraceSection.cs
- XmlSchemaGroupRef.cs
- StorageMappingFragment.cs
- GeneratedView.cs
- Pointer.cs
- Int32CAMarshaler.cs
- Gdiplus.cs
- SafeNativeMethods.cs
- GeneralTransform3DCollection.cs
- FusionWrap.cs
- WebPartEditVerb.cs
- Enum.cs
- InkCanvasSelection.cs
- Debug.cs
- BatchServiceHost.cs
- WsdlBuildProvider.cs
- CqlWriter.cs
- ResourceDescriptionAttribute.cs
- TypeSystem.cs
- SHA256Managed.cs
- DesignerAttribute.cs
- CoreChannel.cs
- CanonicalFontFamilyReference.cs
- SystemIPGlobalProperties.cs
- XmlWrappingWriter.cs
- BaseProcessor.cs
- ListBindableAttribute.cs
- DoubleLink.cs
- Debug.cs
- UIElementCollection.cs
- SafeBitVector32.cs
- Regex.cs
- EntityStoreSchemaFilterEntry.cs
- PathGeometry.cs
- dbenumerator.cs
- HashAlgorithm.cs
- RecordBuilder.cs
- NativeMethodsCLR.cs
- BrowserCapabilitiesCompiler.cs
- FixedSOMTableCell.cs
- Binding.cs
- SystemTcpConnection.cs
- BitmapEffectGeneralTransform.cs
- ToolStripPanelDesigner.cs
- CodeAttributeDeclarationCollection.cs
- HtmlInputImage.cs
- MediaTimeline.cs
- StylusPointCollection.cs
- Transform3DGroup.cs
- Label.cs
- StringUtil.cs
- SystemIPInterfaceProperties.cs
- MobileSysDescriptionAttribute.cs
- JsonEnumDataContract.cs
- SerializableAttribute.cs
- DataContractSet.cs
- SoapMessage.cs
- QueryCacheKey.cs
- StylusPointProperty.cs
- TagNameToTypeMapper.cs
- PKCS1MaskGenerationMethod.cs