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
- TableCellCollection.cs
- ContentTextAutomationPeer.cs
- PartitionerStatic.cs
- XmlTextWriter.cs
- x509store.cs
- SplashScreenNativeMethods.cs
- RelatedCurrencyManager.cs
- WebPartPersonalization.cs
- TextBox.cs
- WebEncodingValidator.cs
- StateRuntime.cs
- Guid.cs
- SettingsPropertyCollection.cs
- PersonalizablePropertyEntry.cs
- ProcessHostConfigUtils.cs
- Point4D.cs
- RequestCache.cs
- TagNameToTypeMapper.cs
- UIElementParagraph.cs
- ImageDrawing.cs
- sqlinternaltransaction.cs
- EmissiveMaterial.cs
- LongMinMaxAggregationOperator.cs
- SessionStateContainer.cs
- PointConverter.cs
- peersecuritysettings.cs
- TypeHelpers.cs
- columnmapkeybuilder.cs
- CallbackValidator.cs
- CroppedBitmap.cs
- DeferredReference.cs
- ButtonBaseAutomationPeer.cs
- DataGridDesigner.cs
- CookieProtection.cs
- CharKeyFrameCollection.cs
- SafeNativeMethods.cs
- LinqDataSourceUpdateEventArgs.cs
- HTTPAPI_VERSION.cs
- RSAOAEPKeyExchangeDeformatter.cs
- ZipFileInfoCollection.cs
- CodeBlockBuilder.cs
- DesignTimeSiteMapProvider.cs
- KeyConverter.cs
- PropertyRecord.cs
- HttpCookieCollection.cs
- DynamicResourceExtensionConverter.cs
- EntityDataSourceDesigner.cs
- WorkflowDesignerColors.cs
- XmlSchemaSubstitutionGroup.cs
- ToolTipService.cs
- RuleSetReference.cs
- DataRowView.cs
- MsmqReceiveHelper.cs
- PropertyExpression.cs
- UserControlParser.cs
- ReadOnlyDictionary.cs
- Utils.cs
- DataException.cs
- DrawingContextWalker.cs
- ACE.cs
- SoapFormatterSinks.cs
- TimelineGroup.cs
- _BufferOffsetSize.cs
- StringAttributeCollection.cs
- ProcessModelSection.cs
- InvalidPrinterException.cs
- WebBrowser.cs
- RectIndependentAnimationStorage.cs
- DataGridTextBox.cs
- SecureStringHasher.cs
- XsdBuildProvider.cs
- TextWriter.cs
- WinFormsSecurity.cs
- ECDiffieHellmanCng.cs
- ZipFileInfo.cs
- Line.cs
- NavigatingCancelEventArgs.cs
- Point.cs
- ObservableCollectionDefaultValueFactory.cs
- Validator.cs
- HttpRequest.cs
- FixedBufferAttribute.cs
- Optimizer.cs
- ConditionalAttribute.cs
- ToolStripPanelRow.cs
- File.cs
- ParallelTimeline.cs
- LinqDataSourceContextEventArgs.cs
- XPathExpr.cs
- XmlTextAttribute.cs
- X509UI.cs
- SearchForVirtualItemEventArgs.cs
- DataTrigger.cs
- COM2TypeInfoProcessor.cs
- SecurityPermission.cs
- EllipseGeometry.cs
- DataTransferEventArgs.cs
- DbConnectionFactory.cs
- ObjectDataSourceDisposingEventArgs.cs
- IDataContractSurrogate.cs