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
- MsmqProcessProtocolHandler.cs
- DataGridPageChangedEventArgs.cs
- TrustLevel.cs
- XPathNodeInfoAtom.cs
- TypeDescriptionProviderAttribute.cs
- FullTrustAssembly.cs
- TrailingSpaceComparer.cs
- WebConfigurationFileMap.cs
- TableLayoutSettingsTypeConverter.cs
- ActivityCompletionCallbackWrapper.cs
- ArrayExtension.cs
- DataGridCellsPanel.cs
- DataFormats.cs
- InvalidPropValue.cs
- DataGridTextBoxColumn.cs
- BindingListCollectionView.cs
- BasicCellRelation.cs
- TracingConnectionListener.cs
- EmptyTextWriter.cs
- SemaphoreFullException.cs
- ConnectionStringsSection.cs
- InvalidDocumentContentsException.cs
- InternalException.cs
- AnnotationMap.cs
- SmiMetaDataProperty.cs
- OrderedDictionaryStateHelper.cs
- CommandDesigner.cs
- DSACryptoServiceProvider.cs
- BooleanAnimationUsingKeyFrames.cs
- XmlByteStreamReader.cs
- RoleGroupCollection.cs
- EventListenerClientSide.cs
- AuthenticationService.cs
- Deflater.cs
- URLMembershipCondition.cs
- BeginStoryboard.cs
- XmlSerializableReader.cs
- __Error.cs
- AdRotator.cs
- returneventsaver.cs
- Annotation.cs
- AssemblyBuilder.cs
- xdrvalidator.cs
- GridSplitter.cs
- TextEditorThreadLocalStore.cs
- DataGridViewCellConverter.cs
- MsmqBindingMonitor.cs
- XmlSchemaAnnotation.cs
- addressfiltermode.cs
- EndpointAddress.cs
- TextClipboardData.cs
- DataRowCollection.cs
- MergePropertyDescriptor.cs
- MULTI_QI.cs
- ToolStripLocationCancelEventArgs.cs
- AlignmentXValidation.cs
- filewebresponse.cs
- XhtmlTextWriter.cs
- ArrayElementGridEntry.cs
- CodeConditionStatement.cs
- InstancePersistenceCommand.cs
- MessageSmuggler.cs
- TreeViewDesigner.cs
- NativeMethods.cs
- SimpleTypesSurrogate.cs
- QuotedStringWriteStateInfo.cs
- DataSourceHelper.cs
- OleDbError.cs
- WindowHideOrCloseTracker.cs
- ConvertEvent.cs
- EntityKeyElement.cs
- TableItemStyle.cs
- ToolStripSettings.cs
- SEHException.cs
- AsyncDataRequest.cs
- activationcontext.cs
- Zone.cs
- InvalidDataContractException.cs
- XmlSchemaDocumentation.cs
- XmlResolver.cs
- DynamicDataManager.cs
- _NtlmClient.cs
- Table.cs
- CqlWriter.cs
- PtsPage.cs
- UrlAuthorizationModule.cs
- BezierSegment.cs
- OdbcFactory.cs
- TdsParameterSetter.cs
- GenericRootAutomationPeer.cs
- RedistVersionInfo.cs
- BorderSidesEditor.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- EditorResources.cs
- TemplateFactory.cs
- PermissionAttributes.cs
- DataFormats.cs
- IISUnsafeMethods.cs
- XPathPatternParser.cs
- ReferentialConstraint.cs