Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / 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. 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
- TokenCreationException.cs
- PartManifestEntry.cs
- BinaryCommonClasses.cs
- MenuBase.cs
- AssemblyBuilder.cs
- HostedImpersonationContext.cs
- GlyphsSerializer.cs
- RectKeyFrameCollection.cs
- SignatureHelper.cs
- InternalControlCollection.cs
- RequestStatusBarUpdateEventArgs.cs
- CreateRefExpr.cs
- IRCollection.cs
- RectConverter.cs
- CapabilitiesAssignment.cs
- AdPostCacheSubstitution.cs
- ActivityBindForm.Designer.cs
- CodeMemberProperty.cs
- GroupQuery.cs
- DependencyPropertyConverter.cs
- XmlNodeList.cs
- FileDialog.cs
- iisPickupDirectory.cs
- MainMenu.cs
- WebPartVerbCollection.cs
- HMACSHA256.cs
- Model3D.cs
- RelationshipDetailsCollection.cs
- RtType.cs
- LabelAutomationPeer.cs
- GridSplitter.cs
- FormViewInsertedEventArgs.cs
- CmsUtils.cs
- MetadataSerializer.cs
- AuthenticationManager.cs
- DataBoundControlAdapter.cs
- TreeNodeMouseHoverEvent.cs
- ProxyFragment.cs
- SqlException.cs
- ResourceLoader.cs
- SmtpClient.cs
- DataGridViewDataConnection.cs
- basevalidator.cs
- PageVisual.cs
- RootBrowserWindowAutomationPeer.cs
- MultipleViewProviderWrapper.cs
- ToolStripSystemRenderer.cs
- SByteConverter.cs
- XPathScanner.cs
- MinimizableAttributeTypeConverter.cs
- PageBuildProvider.cs
- LinkTarget.cs
- CultureTableRecord.cs
- RegexMatchCollection.cs
- PathStreamGeometryContext.cs
- AttributeCollection.cs
- IncrementalReadDecoders.cs
- HandlerBase.cs
- WrapPanel.cs
- Header.cs
- DllNotFoundException.cs
- BamlVersionHeader.cs
- MaterialCollection.cs
- Bitmap.cs
- EntityClientCacheKey.cs
- XamlFigureLengthSerializer.cs
- XmlSchemaSimpleContentRestriction.cs
- SafeSystemMetrics.cs
- WebHttpBindingElement.cs
- InternalControlCollection.cs
- WindowVisualStateTracker.cs
- SerializerDescriptor.cs
- VideoDrawing.cs
- TargetParameterCountException.cs
- WorkflowApplicationAbortedEventArgs.cs
- LingerOption.cs
- BitmapEffectState.cs
- DecimalAnimationUsingKeyFrames.cs
- EventLog.cs
- DataServiceProviderWrapper.cs
- BindingCompleteEventArgs.cs
- StreamWithDictionary.cs
- SettingsSection.cs
- SudsWriter.cs
- TextParagraphCache.cs
- SiteMapNodeItem.cs
- RoutedEvent.cs
- dbenumerator.cs
- InputBinder.cs
- MemberMemberBinding.cs
- dsa.cs
- GroupDescription.cs
- NavigationPropertyEmitter.cs
- ServiceProviders.cs
- TaskResultSetter.cs
- AttachInfo.cs
- RuntimeResourceSet.cs
- AccessViolationException.cs
- MetadataHelper.cs
- XmlDocumentSurrogate.cs