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
- URL.cs
- SystemSounds.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- WaitingCursor.cs
- XmlElementAttribute.cs
- HtmlControl.cs
- PrintingPermissionAttribute.cs
- StartFileNameEditor.cs
- _NegoState.cs
- ActivityDesignerLayoutSerializers.cs
- TreeNodeSelectionProcessor.cs
- LocalizeDesigner.cs
- Error.cs
- ListViewItem.cs
- CompilationRelaxations.cs
- OracleConnectionString.cs
- SchemaCollectionPreprocessor.cs
- ApplyTemplatesAction.cs
- COM2PropertyDescriptor.cs
- PenContexts.cs
- StrokeNodeOperations.cs
- FaultDesigner.cs
- DBConnectionString.cs
- AdornedElementPlaceholder.cs
- XmlWriter.cs
- FamilyMap.cs
- StoreContentChangedEventArgs.cs
- SqlDataSourceAdvancedOptionsForm.cs
- XsdBuildProvider.cs
- FormParameter.cs
- ShimAsPublicXamlType.cs
- SettingsAttributes.cs
- ListBoxItem.cs
- CodeSubDirectory.cs
- EUCJPEncoding.cs
- SupportingTokenListenerFactory.cs
- HashHelpers.cs
- DataSourceControlBuilder.cs
- RecordBuilder.cs
- DispatcherHooks.cs
- TypedElement.cs
- StringDictionary.cs
- ThreadStartException.cs
- SpinWait.cs
- OSFeature.cs
- AtomPub10CategoriesDocumentFormatter.cs
- ListContractAdapter.cs
- ThreadStaticAttribute.cs
- ExceptionUtility.cs
- HMACRIPEMD160.cs
- RefExpr.cs
- ChangeConflicts.cs
- WebBodyFormatMessageProperty.cs
- FormDocumentDesigner.cs
- MasterPage.cs
- TextTreeRootNode.cs
- OracleParameterCollection.cs
- SchemaTableColumn.cs
- DocumentViewerHelper.cs
- Rectangle.cs
- ProtocolsConfigurationHandler.cs
- IListConverters.cs
- LayoutEngine.cs
- WebRequest.cs
- CompositeDuplexBindingElement.cs
- HandlerMappingMemo.cs
- SmtpReplyReader.cs
- ManagementScope.cs
- TypedRowHandler.cs
- ScrollBarRenderer.cs
- SessionEndedEventArgs.cs
- SqlProfileProvider.cs
- LiteralControl.cs
- EditorPartChrome.cs
- FamilyCollection.cs
- StorageScalarPropertyMapping.cs
- DragEventArgs.cs
- ListControl.cs
- WsiProfilesElement.cs
- WaitHandleCannotBeOpenedException.cs
- TdsParserSessionPool.cs
- MaskedTextBoxTextEditor.cs
- SrgsToken.cs
- SurrogateSelector.cs
- KeysConverter.cs
- RolePrincipal.cs
- SqlBuilder.cs
- CompilerErrorCollection.cs
- mil_commands.cs
- BigInt.cs
- DynamicValidator.cs
- BitmapFrame.cs
- SpeechUI.cs
- FixedSOMPage.cs
- ListBase.cs
- Random.cs
- Identifier.cs
- MaskedTextBox.cs
- WorkflowRuntime.cs
- DocumentPageView.cs