Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / MouseButton.cs / 1305600 / 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
- KeyGesture.cs
- SiteMapDataSourceDesigner.cs
- ContainerControl.cs
- DropSource.cs
- KnownBoxes.cs
- MobileSysDescriptionAttribute.cs
- updateconfighost.cs
- ItemChangedEventArgs.cs
- BitmapDownload.cs
- Visitor.cs
- ObjectConverter.cs
- Vector3D.cs
- FixedTextView.cs
- ContainerControlDesigner.cs
- Pkcs7Recipient.cs
- ServicePointManager.cs
- TemplateField.cs
- CollaborationHelperFunctions.cs
- StreamWithDictionary.cs
- HttpCapabilitiesBase.cs
- HttpPostedFile.cs
- PropertyInfoSet.cs
- PartialArray.cs
- ConnectivityStatus.cs
- Geometry.cs
- AnnotationComponentManager.cs
- SeekStoryboard.cs
- HtmlAnchor.cs
- WebPartCancelEventArgs.cs
- CompressStream.cs
- SimpleHandlerBuildProvider.cs
- ModelItemExtensions.cs
- DynamicDataExtensions.cs
- Convert.cs
- FigureHelper.cs
- AssemblyAssociatedContentFileAttribute.cs
- Environment.cs
- TransformerInfoCollection.cs
- PersonalizationEntry.cs
- HtmlInputImage.cs
- ListView.cs
- WorkflowQueueInfo.cs
- SortQueryOperator.cs
- DrawingAttributeSerializer.cs
- PriorityChain.cs
- DataGridViewSelectedCellCollection.cs
- ProcessModule.cs
- RegexBoyerMoore.cs
- TranslateTransform3D.cs
- XamlStream.cs
- Scalars.cs
- KernelTypeValidation.cs
- SqlBulkCopyColumnMapping.cs
- ModelItemKeyValuePair.cs
- MessageEncodingBindingElementImporter.cs
- BinaryObjectReader.cs
- PaintValueEventArgs.cs
- CommonDialog.cs
- Bezier.cs
- Int16AnimationUsingKeyFrames.cs
- CodeExporter.cs
- MetadataHelper.cs
- RadioButtonRenderer.cs
- EmbeddedMailObjectsCollection.cs
- Dynamic.cs
- Timer.cs
- FileLogRecordStream.cs
- X509Certificate2.cs
- AssemblyNameProxy.cs
- dataprotectionpermissionattribute.cs
- Label.cs
- MainMenu.cs
- ResourceCategoryAttribute.cs
- _PooledStream.cs
- XmlQueryStaticData.cs
- AdditionalEntityFunctions.cs
- Compiler.cs
- SqlDelegatedTransaction.cs
- EditorZoneBase.cs
- InkCollectionBehavior.cs
- CodeAccessSecurityEngine.cs
- CngAlgorithmGroup.cs
- LoginViewDesigner.cs
- FormViewInsertedEventArgs.cs
- ProfileSettingsCollection.cs
- DragAssistanceManager.cs
- StringDictionary.cs
- EntityDataSourceChangingEventArgs.cs
- Track.cs
- FlowDocumentFormatter.cs
- AutomationEventArgs.cs
- DataSourceExpression.cs
- xmlsaver.cs
- LinqDataSourceDeleteEventArgs.cs
- ChildrenQuery.cs
- ScrollEvent.cs
- TemplateInstanceAttribute.cs
- BaseDataBoundControl.cs
- RedistVersionInfo.cs
- DataGridTable.cs