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
- ToolStripSplitStackLayout.cs
- Rfc2898DeriveBytes.cs
- XmlDataSourceView.cs
- XmlC14NWriter.cs
- PropertyPathConverter.cs
- TrackingStringDictionary.cs
- HtmlPageAdapter.cs
- StorageTypeMapping.cs
- MarkupProperty.cs
- ProfileProvider.cs
- ZipIOExtraFieldZip64Element.cs
- CollectionViewGroupRoot.cs
- ByteConverter.cs
- GradientPanel.cs
- NominalTypeEliminator.cs
- Size.cs
- StorageEndPropertyMapping.cs
- Buffer.cs
- OrderByBuilder.cs
- Console.cs
- HeaderCollection.cs
- KeyValueConfigurationCollection.cs
- FormClosedEvent.cs
- FormClosedEvent.cs
- InputDevice.cs
- KeyNotFoundException.cs
- SynchronousReceiveElement.cs
- TextElementAutomationPeer.cs
- NumberFormatInfo.cs
- CommonXSendMessage.cs
- ServiceErrorHandler.cs
- BinaryObjectReader.cs
- HttpDictionary.cs
- ExpressionCopier.cs
- HttpCookiesSection.cs
- KerberosRequestorSecurityToken.cs
- OleDbConnectionFactory.cs
- Effect.cs
- FixedHyperLink.cs
- BindingContext.cs
- DataSourceCacheDurationConverter.cs
- InstanceOwnerException.cs
- CreationContext.cs
- ValidatorCompatibilityHelper.cs
- InvokePattern.cs
- Pair.cs
- Rotation3D.cs
- OnOperation.cs
- MSHTMLHost.cs
- MsmqChannelFactory.cs
- TabRenderer.cs
- XmlSignatureManifest.cs
- ConfigurationManagerHelper.cs
- DataControlField.cs
- XmlNamespaceDeclarationsAttribute.cs
- FixedDocument.cs
- FontFaceLayoutInfo.cs
- ReadOnlyDictionary.cs
- CodePageUtils.cs
- HttpRuntimeSection.cs
- StringConverter.cs
- UserControlCodeDomTreeGenerator.cs
- InvariantComparer.cs
- MessageBuilder.cs
- ImageAnimator.cs
- ProvidePropertyAttribute.cs
- RegistryConfigurationProvider.cs
- NodeLabelEditEvent.cs
- Module.cs
- ModuleBuilderData.cs
- LoaderAllocator.cs
- TablePattern.cs
- ProfileSettings.cs
- _TimerThread.cs
- DecoderBestFitFallback.cs
- TextElementEnumerator.cs
- FontSource.cs
- SoapAttributeOverrides.cs
- DSASignatureFormatter.cs
- Vector3DCollection.cs
- SynchronizationLockException.cs
- InvalidProgramException.cs
- HoistedLocals.cs
- CollectionView.cs
- SizeLimitedCache.cs
- ScrollItemPattern.cs
- MDIControlStrip.cs
- DataObject.cs
- SByteStorage.cs
- DropTarget.cs
- ExpressionReplacer.cs
- ListBoxAutomationPeer.cs
- HtmlForm.cs
- HyperLinkStyle.cs
- TreeSet.cs
- StringDictionaryWithComparer.cs
- Pair.cs
- ServiceEndpoint.cs
- ProfileWorkflowElement.cs
- BoundField.cs