Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / 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.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- CqlIdentifiers.cs
- XomlCompilerParameters.cs
- UpdatableWrapper.cs
- AssemblyAttributes.cs
- TrackingConditionCollection.cs
- ManagedWndProcTracker.cs
- AsyncResult.cs
- ObjectPropertyMapping.cs
- CannotUnloadAppDomainException.cs
- DrawingState.cs
- RowToFieldTransformer.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- _NtlmClient.cs
- RectangleHotSpot.cs
- BufferedOutputStream.cs
- PresentationAppDomainManager.cs
- HtmlInputImage.cs
- ThicknessKeyFrameCollection.cs
- RewritingSimplifier.cs
- ISessionStateStore.cs
- Geometry3D.cs
- RowUpdatingEventArgs.cs
- AncillaryOps.cs
- DataServiceProcessingPipelineEventArgs.cs
- _CookieModule.cs
- WsdlInspector.cs
- SystemDropShadowChrome.cs
- ProofTokenCryptoHandle.cs
- InputLangChangeEvent.cs
- SplitContainer.cs
- FileChangesMonitor.cs
- TrackingConditionCollection.cs
- Model3DGroup.cs
- HttpRawResponse.cs
- CssClassPropertyAttribute.cs
- EncoderReplacementFallback.cs
- DragDropHelper.cs
- SchemaAttDef.cs
- HttpPostProtocolImporter.cs
- XmlDocument.cs
- Process.cs
- ObjectConverter.cs
- StsCommunicationException.cs
- CmsUtils.cs
- XmlSchemas.cs
- TreeNodeStyleCollection.cs
- ApplicationServiceManager.cs
- CachedFontFamily.cs
- ThreadStateException.cs
- SecurityResources.cs
- DataPagerFieldCommandEventArgs.cs
- TaskFormBase.cs
- ApplicationId.cs
- PackageRelationshipSelector.cs
- _ConnectOverlappedAsyncResult.cs
- XPathPatternParser.cs
- ActiveDocumentEvent.cs
- ServiceDocumentFormatter.cs
- CellIdBoolean.cs
- SqlConnectionFactory.cs
- OrderedDictionaryStateHelper.cs
- CachedFontFamily.cs
- PropertyValueUIItem.cs
- SQLString.cs
- UnsafeNativeMethods.cs
- Int16Converter.cs
- CollectionEditorDialog.cs
- TypeGeneratedEventArgs.cs
- CultureTableRecord.cs
- BufferedWebEventProvider.cs
- LOSFormatter.cs
- JsonReader.cs
- BinHexEncoder.cs
- PrivilegedConfigurationManager.cs
- cryptoapiTransform.cs
- ProcessStartInfo.cs
- PropertyDescriptor.cs
- DataContractSerializer.cs
- DataGridColumnDropSeparator.cs
- ELinqQueryState.cs
- FlowLayoutPanel.cs
- XmlSchemaSimpleType.cs
- ComplexType.cs
- TargetParameterCountException.cs
- ConnectionManagementSection.cs
- PatternMatcher.cs
- FastEncoderWindow.cs
- MonikerHelper.cs
- FacetEnabledSchemaElement.cs
- FlowDocumentScrollViewer.cs
- IdentifierCollection.cs
- ForEachDesigner.xaml.cs
- MimeTypePropertyAttribute.cs
- dbdatarecord.cs
- UrlMappingsSection.cs
- codemethodreferenceexpression.cs
- CapabilitiesSection.cs
- DropSourceBehavior.cs
- UncommonField.cs
- TransformerInfo.cs