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
- HtmlWindow.cs
- SafeBuffer.cs
- FontCollection.cs
- SiteMapDataSourceDesigner.cs
- _Events.cs
- SourceSwitch.cs
- SafeProcessHandle.cs
- BitmapEffectDrawing.cs
- SourceElementsCollection.cs
- SslStreamSecurityElement.cs
- SqlDataSourceConnectionPanel.cs
- TraceUtility.cs
- FilterQueryOptionExpression.cs
- XMLUtil.cs
- Random.cs
- activationcontext.cs
- InfoCardTrace.cs
- EmptyElement.cs
- StaticExtension.cs
- DataViewListener.cs
- DataGridViewRowHeightInfoNeededEventArgs.cs
- HttpCacheVary.cs
- XmlTextReaderImpl.cs
- Size3D.cs
- Tracking.cs
- CodeBinaryOperatorExpression.cs
- ContractMapping.cs
- grammarelement.cs
- QilLoop.cs
- ListViewAutomationPeer.cs
- NetworkInformationException.cs
- InputBuffer.cs
- MessageHeaderT.cs
- GlyphingCache.cs
- EtwTrace.cs
- LogicalExpr.cs
- Error.cs
- TextAnchor.cs
- recordstatescratchpad.cs
- Util.cs
- DataGridViewCellValueEventArgs.cs
- EpmCustomContentSerializer.cs
- WebPartConnectionsCancelEventArgs.cs
- IHttpResponseInternal.cs
- MatchAttribute.cs
- InvokeSchedule.cs
- UrlMappingsModule.cs
- AppDomainShutdownMonitor.cs
- wgx_commands.cs
- DataControlFieldTypeEditor.cs
- ConsumerConnectionPoint.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- AppSecurityManager.cs
- CodePageUtils.cs
- BinarySerializer.cs
- SiblingIterators.cs
- GridViewCommandEventArgs.cs
- RenderData.cs
- ObjectRef.cs
- EllipseGeometry.cs
- PersonalizationState.cs
- ConfigXmlSignificantWhitespace.cs
- SBCSCodePageEncoding.cs
- SqlDataSourceSelectingEventArgs.cs
- ConditionalBranch.cs
- ErrorStyle.cs
- securitycriticaldataClass.cs
- WebConfigManager.cs
- UpdatePanelTrigger.cs
- ListViewItem.cs
- ShutDownListener.cs
- TextStore.cs
- CompilationLock.cs
- DetailsViewUpdateEventArgs.cs
- WindowsScroll.cs
- DayRenderEvent.cs
- OutOfProcStateClientManager.cs
- Ipv6Element.cs
- EraserBehavior.cs
- ImportException.cs
- cache.cs
- InfoCardRSAOAEPKeyExchangeDeformatter.cs
- TriggerCollection.cs
- ClockGroup.cs
- DispatchWrapper.cs
- ServerValidateEventArgs.cs
- DefaultTraceListener.cs
- PeerNode.cs
- TokenBasedSetEnumerator.cs
- SchemaCollectionPreprocessor.cs
- CapabilitiesUse.cs
- PropertyPath.cs
- StylusEditingBehavior.cs
- DataGridViewCellErrorTextNeededEventArgs.cs
- WebPartDisplayModeEventArgs.cs
- BaseAddressElementCollection.cs
- ConfigurationManager.cs
- PolyLineSegment.cs
- RadialGradientBrush.cs
- XamlParser.cs