Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / MouseButtonEventArgs.cs / 1305600 / 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
- WindowsGraphics.cs
- TraceSection.cs
- ParseNumbers.cs
- TableSectionStyle.cs
- HMACSHA384.cs
- unsafeIndexingFilterStream.cs
- TraceEventCache.cs
- PeerApplication.cs
- HttpApplication.cs
- SerializationEventsCache.cs
- URL.cs
- DelegateInArgument.cs
- ConstructorBuilder.cs
- NamespaceMapping.cs
- DrawTreeNodeEventArgs.cs
- DriveInfo.cs
- SafeArrayRankMismatchException.cs
- DataGridViewComboBoxCell.cs
- Socket.cs
- FloatUtil.cs
- HostnameComparisonMode.cs
- MetadataItemCollectionFactory.cs
- UnsafeNativeMethods.cs
- WhitespaceRuleReader.cs
- DataKey.cs
- MailMessageEventArgs.cs
- CharacterMetrics.cs
- AtomContentProperty.cs
- ChtmlCalendarAdapter.cs
- AnonymousIdentificationModule.cs
- LongCountAggregationOperator.cs
- Encoder.cs
- DirectoryRedirect.cs
- GlyphRunDrawing.cs
- SymmetricAlgorithm.cs
- XmlUtil.cs
- ApplicationActivator.cs
- MultiByteCodec.cs
- PersistencePipeline.cs
- SqlTransaction.cs
- SoapServerMessage.cs
- RedBlackList.cs
- Style.cs
- CryptoSession.cs
- Lease.cs
- ViewBase.cs
- UIElementCollection.cs
- TextTreeInsertUndoUnit.cs
- InkCanvasAutomationPeer.cs
- BuilderPropertyEntry.cs
- DataGridState.cs
- XmlText.cs
- OleDbConnectionInternal.cs
- RadioButtonBaseAdapter.cs
- WebPartConnectionsCancelVerb.cs
- Typeface.cs
- CodeTryCatchFinallyStatement.cs
- RegexRunner.cs
- RowToParametersTransformer.cs
- XmlReflectionMember.cs
- TraceUtils.cs
- XmlSchemaFacet.cs
- MatrixStack.cs
- XslAstAnalyzer.cs
- XmlTypeAttribute.cs
- WebBrowserNavigatingEventHandler.cs
- WebPartConnectVerb.cs
- ConfigurationSectionGroup.cs
- PropertyTabAttribute.cs
- HtmlLink.cs
- CLSCompliantAttribute.cs
- PointAnimation.cs
- ConfigurationPropertyAttribute.cs
- CodeVariableReferenceExpression.cs
- ProviderMetadata.cs
- MetafileHeaderWmf.cs
- Popup.cs
- DataGridSortCommandEventArgs.cs
- RootNamespaceAttribute.cs
- XPathNavigatorReader.cs
- VisualSerializer.cs
- BinaryKeyIdentifierClause.cs
- WebPartsPersonalizationAuthorization.cs
- HighlightComponent.cs
- Stack.cs
- ComponentChangedEvent.cs
- BufferBuilder.cs
- AuthenticationConfig.cs
- PenLineCapValidation.cs
- ServiceModelConfiguration.cs
- WinFormsSecurity.cs
- TraceSection.cs
- IPGlobalProperties.cs
- BStrWrapper.cs
- GcHandle.cs
- EncoderReplacementFallback.cs
- recordstate.cs
- xdrvalidator.cs
- MsmqIntegrationChannelListener.cs
- ResponseBodyWriter.cs