Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / MouseEventArgs.cs / 1305600 / 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
- RtfControlWordInfo.cs
- XPathDocumentBuilder.cs
- WebPartZoneDesigner.cs
- sqlstateclientmanager.cs
- AnnotationElement.cs
- XsltSettings.cs
- CodeParameterDeclarationExpression.cs
- TextDocumentView.cs
- SqlAggregateChecker.cs
- _HeaderInfo.cs
- ComponentChangedEvent.cs
- FusionWrap.cs
- DragCompletedEventArgs.cs
- RelationshipWrapper.cs
- DescendantQuery.cs
- XmlSchemaIdentityConstraint.cs
- XmlAnyAttributeAttribute.cs
- Symbol.cs
- WsatServiceAddress.cs
- DataGridViewCellFormattingEventArgs.cs
- OpenTypeLayoutCache.cs
- XamlSerializerUtil.cs
- NotImplementedException.cs
- DataGrid.cs
- TCEAdapterGenerator.cs
- ElementsClipboardData.cs
- AbstractSvcMapFileLoader.cs
- CustomError.cs
- FontUnit.cs
- BindToObject.cs
- DiagnosticsConfigurationHandler.cs
- Transactions.cs
- SerialStream.cs
- SoapDocumentServiceAttribute.cs
- DataGridState.cs
- XmlILStorageConverter.cs
- DataObject.cs
- ItemCollection.cs
- TempFiles.cs
- COM2Properties.cs
- FormCollection.cs
- HtmlElementCollection.cs
- CompoundFileIOPermission.cs
- ArrangedElement.cs
- ManipulationPivot.cs
- DecoderBestFitFallback.cs
- CharEnumerator.cs
- Version.cs
- IOThreadScheduler.cs
- WindowsPen.cs
- ImageListUtils.cs
- SyndicationElementExtension.cs
- NegotiateStream.cs
- FileClassifier.cs
- ZoneLinkButton.cs
- WindowsTokenRoleProvider.cs
- WizardStepBase.cs
- ToolboxDataAttribute.cs
- AnyReturnReader.cs
- FloaterBaseParagraph.cs
- X509ChainElement.cs
- IriParsingElement.cs
- QueryExpr.cs
- Marshal.cs
- CapabilitiesUse.cs
- DockProviderWrapper.cs
- ContentFilePart.cs
- DataGridItemAttachedStorage.cs
- TextBoxAutoCompleteSourceConverter.cs
- DataGridRow.cs
- ExceptionWrapper.cs
- ResolveDuplexCD1AsyncResult.cs
- TypeTypeConverter.cs
- Propagator.Evaluator.cs
- WebPartCloseVerb.cs
- Baml2006SchemaContext.cs
- DispatcherEventArgs.cs
- EdmFunction.cs
- EntityTypeEmitter.cs
- WinHttpWebProxyFinder.cs
- SimpleBitVector32.cs
- SiteMap.cs
- CodeMethodReturnStatement.cs
- ExtendedPropertyCollection.cs
- AutomationEventArgs.cs
- _LazyAsyncResult.cs
- GeneralTransform2DTo3D.cs
- SqlProcedureAttribute.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- CompositionAdorner.cs
- SmtpDateTime.cs
- NestPullup.cs
- DetailsViewPageEventArgs.cs
- ClusterRegistryConfigurationProvider.cs
- SecurityTokenProvider.cs
- Vector.cs
- ObjectQuery_EntitySqlExtensions.cs
- TextRangeProviderWrapper.cs
- MetafileHeader.cs
- RoleGroupCollection.cs