Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Input / MouseButton.cs / 1 / MouseButton.cs
using System; using MS.Internal.PresentationCore; namespace System.Windows.Input { ////// The MouseButton enumeration describes the buttons available on /// the mouse device. /// ////// You must update MouseButtonUtilities.Validate if any changes are made to this type /// public enum MouseButton { ////// The left mouse button. /// Left, ////// The middle mouse button. /// Middle, ////// The right mouse button. /// Right, ////// The fourth mouse button. /// XButton1, ////// The fifth mouse button. /// XButton2 } ////// Utility class for MouseButton /// internal sealed class MouseButtonUtilities { ////// Private placeholder constructor /// ////// There is present to supress the autogeneration of a public one, which /// triggers an FxCop violation, as this is an internal class that is never instantiated /// private MouseButtonUtilities() { } ////// Ensures MouseButton is set to a valid value. /// ////// There is a proscription against using Enum.IsDefined(). (it is slow) /// So we manually validate using a switch statement. /// [FriendAccessAllowed] internal static void Validate(MouseButton button) { switch(button) { case MouseButton.Left: case MouseButton.Middle: case MouseButton.Right: case MouseButton.XButton1: case MouseButton.XButton2: break; default: throw new System.ComponentModel.InvalidEnumArgumentException("button", (int)button, typeof(MouseButton)); } } } } // 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
- DataStreams.cs
- CommandValueSerializer.cs
- ObjectItemCachedAssemblyLoader.cs
- LifetimeServices.cs
- ComponentChangedEvent.cs
- DesigntimeLicenseContextSerializer.cs
- CompilerParameters.cs
- SafeSerializationManager.cs
- Rfc4050KeyFormatter.cs
- EntityDataSourceEntityTypeFilterItem.cs
- ToolBar.cs
- CodeDelegateCreateExpression.cs
- VectorCollection.cs
- BitmapFrame.cs
- PrintPageEvent.cs
- MappingException.cs
- SendParametersContent.cs
- GridViewRowPresenterBase.cs
- NavigationWindowAutomationPeer.cs
- WindowsHyperlink.cs
- ContractMapping.cs
- XhtmlBasicSelectionListAdapter.cs
- InvalidDataException.cs
- CopyAttributesAction.cs
- FormView.cs
- BatchParser.cs
- ProjectionPath.cs
- BounceEase.cs
- HtmlInputHidden.cs
- RouteItem.cs
- ToolStripComboBox.cs
- Publisher.cs
- HttpResponseHeader.cs
- X509ChainElement.cs
- LogWriteRestartAreaAsyncResult.cs
- RouteUrlExpressionBuilder.cs
- JumpTask.cs
- TimeSpanMinutesOrInfiniteConverter.cs
- SessionPageStatePersister.cs
- DisposableCollectionWrapper.cs
- SoapElementAttribute.cs
- InternalUserCancelledException.cs
- RectangleHotSpot.cs
- GenericEnumConverter.cs
- FixedNode.cs
- MinimizableAttributeTypeConverter.cs
- FrameworkContentElement.cs
- ClientData.cs
- Native.cs
- NGCSerializationManagerAsync.cs
- WSHttpBindingCollectionElement.cs
- ThicknessAnimation.cs
- ImageBrush.cs
- ExcCanonicalXml.cs
- XPathItem.cs
- PhonemeConverter.cs
- ImageAttributes.cs
- DynamicField.cs
- ReflectTypeDescriptionProvider.cs
- ActivityInstanceReference.cs
- XDeferredAxisSource.cs
- TypeProvider.cs
- DbConnectionPoolGroup.cs
- ListItemConverter.cs
- CharStorage.cs
- SoapReflectionImporter.cs
- SvcMapFileLoader.cs
- RelationshipWrapper.cs
- basecomparevalidator.cs
- ToolboxItemAttribute.cs
- handlecollector.cs
- ProtectedConfiguration.cs
- DiscoveryOperationContextExtension.cs
- OpenTypeLayoutCache.cs
- TcpTransportSecurityElement.cs
- GenerateHelper.cs
- OleServicesContext.cs
- VectorCollection.cs
- PackageRelationshipSelector.cs
- LockedHandleGlyph.cs
- HWStack.cs
- BaseServiceProvider.cs
- ImageAutomationPeer.cs
- EmptyStringExpandableObjectConverter.cs
- PagePropertiesChangingEventArgs.cs
- XPathAncestorIterator.cs
- LinearGradientBrush.cs
- CatalogPartCollection.cs
- GridViewRowEventArgs.cs
- DetailsViewActionList.cs
- InternalConfigRoot.cs
- RtType.cs
- RangeBaseAutomationPeer.cs
- ListViewItemMouseHoverEvent.cs
- ImageButton.cs
- MemberInfoSerializationHolder.cs
- DataGridViewAutoSizeModeEventArgs.cs
- FormsAuthenticationTicket.cs
- GridViewRowCollection.cs
- EventWaitHandle.cs