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
- DeploymentSectionCache.cs
- BitmapScalingModeValidation.cs
- DataListItem.cs
- Rules.cs
- DependencyPropertyValueSerializer.cs
- SqlNotificationRequest.cs
- ResumeStoryboard.cs
- SEHException.cs
- TreeBuilderBamlTranslator.cs
- DataComponentGenerator.cs
- RunClient.cs
- UpdateTranslator.cs
- TextRunTypographyProperties.cs
- Part.cs
- LookupBindingPropertiesAttribute.cs
- LabelExpression.cs
- VisualTreeHelper.cs
- SystemDiagnosticsSection.cs
- SqlDataSourceSelectingEventArgs.cs
- QueryPageSettingsEventArgs.cs
- ExceptionValidationRule.cs
- AttachmentCollection.cs
- FixedPageAutomationPeer.cs
- ConfigurationStrings.cs
- EnterpriseServicesHelper.cs
- NetworkInterface.cs
- DataListItemCollection.cs
- FormattedTextSymbols.cs
- FontWeights.cs
- Substitution.cs
- MaskedTextBox.cs
- DropSource.cs
- HttpApplicationStateBase.cs
- EventLogEntryCollection.cs
- PerfService.cs
- TextBoxBase.cs
- ChannelEndpointElementCollection.cs
- CheckStoreFileValidityRequest.cs
- BindingCompleteEventArgs.cs
- securestring.cs
- TraceHelpers.cs
- DocumentSchemaValidator.cs
- RelationshipFixer.cs
- DocumentXPathNavigator.cs
- WinCategoryAttribute.cs
- DataGridViewLayoutData.cs
- ListViewItem.cs
- elementinformation.cs
- DocumentXPathNavigator.cs
- TemplateAction.cs
- BaseDataList.cs
- BitmapInitialize.cs
- DateRangeEvent.cs
- ThreadStartException.cs
- BamlBinaryReader.cs
- GeneralTransform3D.cs
- NotificationContext.cs
- XmlSerializationReader.cs
- RSAPKCS1KeyExchangeFormatter.cs
- RenderTargetBitmap.cs
- webclient.cs
- LowerCaseStringConverter.cs
- DesignerSerializationOptionsAttribute.cs
- IsolatedStorage.cs
- InputScope.cs
- DataGridViewCellStyleEditor.cs
- Base64Encoder.cs
- Utils.cs
- dsa.cs
- DecimalAnimation.cs
- BinaryParser.cs
- DrawingCollection.cs
- QilDataSource.cs
- TargetParameterCountException.cs
- DesignTimeParseData.cs
- NotImplementedException.cs
- HtmlTable.cs
- EmptyCollection.cs
- WorkflowMarkupSerializer.cs
- CompositeActivityCodeGenerator.cs
- ClaimComparer.cs
- ChoiceConverter.cs
- Rect3DValueSerializer.cs
- BinaryWriter.cs
- UntypedNullExpression.cs
- InteropAutomationProvider.cs
- UserControl.cs
- InvocationExpression.cs
- ComponentChangedEvent.cs
- WS2007FederationHttpBindingCollectionElement.cs
- XPathNodeIterator.cs
- XamlValidatingReader.cs
- SqlCacheDependency.cs
- NativeWrapper.cs
- GroupBoxRenderer.cs
- Stream.cs
- RedirectionProxy.cs
- SecurityTokenRequirement.cs
- DelimitedListTraceListener.cs
- LinqDataSourceDeleteEventArgs.cs