Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Input / MouseEventArgs.cs / 1 / MouseEventArgs.cs
using System.Collections; using System; namespace System.Windows.Input { ////// The MouseEventArgs class provides access to the logical /// Mouse device for all derived event args. /// public class MouseEventArgs : InputEventArgs { ////// Initializes a new instance of the MouseEventArgs class. /// /// /// The logical Mouse device associated with this event. /// /// /// The time when the input occured. /// public MouseEventArgs(MouseDevice mouse, int timestamp) : base(mouse, timestamp) { if( mouse == null ) { throw new System.ArgumentNullException("mouse"); } _stylusDevice = null; } ////// Initializes a new instance of the MouseEventArgs class. /// /// /// The logical Mouse device associated with this event. /// /// /// The time when the input occured. /// /// /// The stylus device that was involved with this event. /// public MouseEventArgs(MouseDevice mouse, int timestamp, StylusDevice stylusDevice) : base(mouse, timestamp) { if( mouse == null ) { throw new System.ArgumentNullException("mouse"); } _stylusDevice = stylusDevice; } ////// Read-only access to the mouse device associated with this /// event. /// public MouseDevice MouseDevice { get {return (MouseDevice) this.Device;} } ////// Read-only access to the stylus Mouse associated with this event. /// public StylusDevice StylusDevice { get {return _stylusDevice;} } ////// Calculates the position of the mouse relative to /// a particular element. /// public Point GetPosition(IInputElement relativeTo) { return this.MouseDevice.GetPosition(relativeTo); } ////// The state of the left button. /// public MouseButtonState LeftButton { get { return this.MouseDevice.LeftButton; } } ////// The state of the right button. /// public MouseButtonState RightButton { get { return this.MouseDevice.RightButton; } } ////// The state of the middle button. /// public MouseButtonState MiddleButton { get { return this.MouseDevice.MiddleButton; } } ////// The state of the first extended button. /// public MouseButtonState XButton1 { get { return this.MouseDevice.XButton1; } } ////// The state of the second extended button. /// public MouseButtonState XButton2 { get { return this.MouseDevice.XButton2; } } ////// 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) { MouseEventHandler handler = (MouseEventHandler) genericHandler; handler(genericTarget, this); } private StylusDevice _stylusDevice; } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. using System.Collections; using System; namespace System.Windows.Input { ////// The MouseEventArgs class provides access to the logical /// Mouse device for all derived event args. /// public class MouseEventArgs : InputEventArgs { ////// Initializes a new instance of the MouseEventArgs class. /// /// /// The logical Mouse device associated with this event. /// /// /// The time when the input occured. /// public MouseEventArgs(MouseDevice mouse, int timestamp) : base(mouse, timestamp) { if( mouse == null ) { throw new System.ArgumentNullException("mouse"); } _stylusDevice = null; } ////// Initializes a new instance of the MouseEventArgs class. /// /// /// The logical Mouse device associated with this event. /// /// /// The time when the input occured. /// /// /// The stylus device that was involved with this event. /// public MouseEventArgs(MouseDevice mouse, int timestamp, StylusDevice stylusDevice) : base(mouse, timestamp) { if( mouse == null ) { throw new System.ArgumentNullException("mouse"); } _stylusDevice = stylusDevice; } ////// Read-only access to the mouse device associated with this /// event. /// public MouseDevice MouseDevice { get {return (MouseDevice) this.Device;} } ////// Read-only access to the stylus Mouse associated with this event. /// public StylusDevice StylusDevice { get {return _stylusDevice;} } ////// Calculates the position of the mouse relative to /// a particular element. /// public Point GetPosition(IInputElement relativeTo) { return this.MouseDevice.GetPosition(relativeTo); } ////// The state of the left button. /// public MouseButtonState LeftButton { get { return this.MouseDevice.LeftButton; } } ////// The state of the right button. /// public MouseButtonState RightButton { get { return this.MouseDevice.RightButton; } } ////// The state of the middle button. /// public MouseButtonState MiddleButton { get { return this.MouseDevice.MiddleButton; } } ////// The state of the first extended button. /// public MouseButtonState XButton1 { get { return this.MouseDevice.XButton1; } } ////// The state of the second extended button. /// public MouseButtonState XButton2 { get { return this.MouseDevice.XButton2; } } ////// 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) { MouseEventHandler handler = (MouseEventHandler) genericHandler; handler(genericTarget, this); } private StylusDevice _stylusDevice; } } // 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
- StatusBar.cs
- EventPropertyMap.cs
- PropertyIDSet.cs
- RtfNavigator.cs
- SHA256CryptoServiceProvider.cs
- PackagingUtilities.cs
- _Events.cs
- CommandField.cs
- CLSCompliantAttribute.cs
- datacache.cs
- XmlWrappingReader.cs
- DBNull.cs
- FloatUtil.cs
- XamlStackWriter.cs
- BitmapInitialize.cs
- FlowDecisionDesigner.xaml.cs
- ProxyWebPart.cs
- SafeBitVector32.cs
- Root.cs
- ToolStripPanelRenderEventArgs.cs
- CallContext.cs
- HotSpotCollection.cs
- OleAutBinder.cs
- PostBackOptions.cs
- FromRequest.cs
- RewritingValidator.cs
- DataFormat.cs
- BaseDataBoundControl.cs
- ReferenceEqualityComparer.cs
- _TLSstream.cs
- XmlUtil.cs
- CharStorage.cs
- DetailsViewInsertEventArgs.cs
- SmtpFailedRecipientsException.cs
- PenThreadPool.cs
- CommonDialog.cs
- WhitespaceRuleReader.cs
- GetPageNumberCompletedEventArgs.cs
- XmlTextAttribute.cs
- SqlProvider.cs
- WebBrowserNavigatingEventHandler.cs
- Accessors.cs
- CalculatedColumn.cs
- OperationParameterInfoCollection.cs
- ImpersonateTokenRef.cs
- Point3D.cs
- AssociationType.cs
- AppSettingsSection.cs
- DtrList.cs
- UxThemeWrapper.cs
- TransactionTraceIdentifier.cs
- RestHandler.cs
- SafeBuffer.cs
- DataGridViewButtonColumn.cs
- ObjectViewFactory.cs
- SHA512Managed.cs
- SmiEventStream.cs
- GetPageCompletedEventArgs.cs
- ISCIIEncoding.cs
- DocumentCollection.cs
- Atom10FormatterFactory.cs
- XmlSchemas.cs
- VScrollBar.cs
- DragStartedEventArgs.cs
- UpDownEvent.cs
- MimeBasePart.cs
- XslTransform.cs
- SuppressMessageAttribute.cs
- TableCellCollection.cs
- HtmlMeta.cs
- TypeSystemHelpers.cs
- AnimationStorage.cs
- Int32Rect.cs
- DataGridViewComboBoxCell.cs
- UInt64Storage.cs
- HitTestResult.cs
- HwndSourceKeyboardInputSite.cs
- XamlTreeBuilderBamlRecordWriter.cs
- MatrixIndependentAnimationStorage.cs
- keycontainerpermission.cs
- WebPartConnectionsDisconnectVerb.cs
- IPEndPoint.cs
- ProcessInputEventArgs.cs
- SmiConnection.cs
- DropShadowBitmapEffect.cs
- ToolStripSplitButton.cs
- QueryStack.cs
- ExtendedProperty.cs
- ReliableOutputConnection.cs
- BaseCollection.cs
- HtmlGenericControl.cs
- Serializer.cs
- TraceFilter.cs
- SR.cs
- SelectionHighlightInfo.cs
- ReadOnlyHierarchicalDataSource.cs
- ScaleTransform3D.cs
- BStrWrapper.cs
- ConfigurationErrorsException.cs
- NativeMethods.cs