Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Input / MouseButtonEventArgs.cs / 1 / MouseButtonEventArgs.cs
using System; namespace System.Windows.Input { ////// The MouseButtonEventArgs describes the state of a Mouse button. /// public class MouseButtonEventArgs : MouseEventArgs { ////// Initializes a new instance of the MouseButtonEventArgs class. /// /// /// The logical Mouse device associated with this event. /// /// /// The time when the input occured. /// /// /// The mouse button whose state is being described. /// public MouseButtonEventArgs(MouseDevice mouse, int timestamp, MouseButton button) : base(mouse, timestamp) { MouseButtonUtilities.Validate(button); _button = button; _count = 1; } ////// Initializes a new instance of the MouseButtonEventArgs class. /// /// /// The logical Mouse device associated with this event. /// /// /// The time when the input occured. /// /// /// The Mouse button whose state is being described. /// /// /// The stylus device that was involved with this event. /// public MouseButtonEventArgs(MouseDevice mouse, int timestamp, MouseButton button, StylusDevice stylusDevice) : base(mouse, timestamp, stylusDevice) { MouseButtonUtilities.Validate(button); _button = button; _count = 1; } ////// Read-only access to the button being described. /// public MouseButton ChangedButton { get {return _button;} } ////// Read-only access to the button state. /// public MouseButtonState ButtonState { get { MouseButtonState state = MouseButtonState.Released; switch(_button) { case MouseButton.Left: state = this.MouseDevice.LeftButton; break; case MouseButton.Right: state = this.MouseDevice.RightButton; break; case MouseButton.Middle: state = this.MouseDevice.MiddleButton; break; case MouseButton.XButton1: state = this.MouseDevice.XButton1; break; case MouseButton.XButton2: state = this.MouseDevice.XButton2; break; } return state; } } ////// Read access to the button click count. /// public int ClickCount { get {return _count;} internal set { _count = value;} } ////// 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) { MouseButtonEventHandler handler = (MouseButtonEventHandler) genericHandler; handler(genericTarget, this); } private MouseButton _button; private int _count; } } // 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
- CqlParser.cs
- WebPartConnectionsCloseVerb.cs
- TableAdapterManagerGenerator.cs
- ItemType.cs
- WebPartConnectionsCloseVerb.cs
- DateTimeConverter2.cs
- SystemWebCachingSectionGroup.cs
- RemoteX509Token.cs
- BamlVersionHeader.cs
- AtomMaterializer.cs
- MetadataException.cs
- CodeDOMUtility.cs
- QilIterator.cs
- ConfigViewGenerator.cs
- RuntimeResourceSet.cs
- SafePEFileHandle.cs
- FontDifferentiator.cs
- ValidatingReaderNodeData.cs
- WizardDesigner.cs
- FontSourceCollection.cs
- ISAPIWorkerRequest.cs
- NumberSubstitution.cs
- MeshGeometry3D.cs
- TraceFilter.cs
- EditingCoordinator.cs
- GeneralTransform3D.cs
- Int64Storage.cs
- ListBindingConverter.cs
- TrustLevel.cs
- followingsibling.cs
- DataBindingCollection.cs
- ContextMenu.cs
- ReaderOutput.cs
- TreeNodeEventArgs.cs
- DataSourceXmlTextReader.cs
- HitTestParameters.cs
- MaskInputRejectedEventArgs.cs
- WindowsFormsLinkLabel.cs
- BitmapSource.cs
- _LoggingObject.cs
- UIAgentRequest.cs
- ToolbarAUtomationPeer.cs
- DirectoryInfo.cs
- ScriptingJsonSerializationSection.cs
- CodeAccessSecurityEngine.cs
- WsatAdminException.cs
- CodeDOMUtility.cs
- IDictionary.cs
- SessionStateSection.cs
- RsaElement.cs
- QueryProcessor.cs
- BaseParser.cs
- PageFunction.cs
- LiteralTextParser.cs
- ClientSession.cs
- XmlSchemaObjectCollection.cs
- GlobalItem.cs
- RightsManagementPermission.cs
- ConnectivityStatus.cs
- ColumnHeader.cs
- IndicCharClassifier.cs
- XmlCharType.cs
- DocobjHost.cs
- JapaneseLunisolarCalendar.cs
- AppDomainAttributes.cs
- SafeFileHandle.cs
- BaseWebProxyFinder.cs
- XPathParser.cs
- WMIGenerator.cs
- DesignerObject.cs
- MissingFieldException.cs
- EntityDataSourceSelectingEventArgs.cs
- ListBindingHelper.cs
- ContentControl.cs
- CatalogPartChrome.cs
- Pen.cs
- _OverlappedAsyncResult.cs
- UnconditionalPolicy.cs
- PageClientProxyGenerator.cs
- odbcmetadatacollectionnames.cs
- SqlCommandSet.cs
- TcpTransportSecurity.cs
- ScriptMethodAttribute.cs
- ToolStripButton.cs
- ConnectionsZoneDesigner.cs
- SqlDataSourceQuery.cs
- ParserHooks.cs
- X509CertificateRecipientServiceCredential.cs
- WhileDesigner.cs
- BitmapPalette.cs
- NamespaceCollection.cs
- ProxyWebPart.cs
- cryptoapiTransform.cs
- Parallel.cs
- FlowDecisionDesigner.xaml.cs
- SiteMapNodeCollection.cs
- ColumnCollection.cs
- WmfPlaceableFileHeader.cs
- ShaderEffect.cs
- PointLight.cs