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
- Nodes.cs
- ListViewEditEventArgs.cs
- SoapServerMessage.cs
- BrowserCapabilitiesFactory.cs
- Types.cs
- MouseGestureValueSerializer.cs
- Emitter.cs
- SoapSchemaExporter.cs
- GPRECT.cs
- BoundColumn.cs
- DelegatingConfigHost.cs
- DisableDpiAwarenessAttribute.cs
- CaretElement.cs
- HTMLTagNameToTypeMapper.cs
- ListMarkerSourceInfo.cs
- RegisteredHiddenField.cs
- ControlAdapter.cs
- KeyedCollection.cs
- NominalTypeEliminator.cs
- Matrix3DStack.cs
- ObjectDataSource.cs
- WorkflowDesignerMessageFilter.cs
- DirectoryGroupQuery.cs
- XmlDataCollection.cs
- SoapDocumentServiceAttribute.cs
- DataSetMappper.cs
- PeerEndPoint.cs
- GlobalizationAssembly.cs
- PhotoPrintingIntent.cs
- ControlHelper.cs
- TrackingExtract.cs
- XmlIncludeAttribute.cs
- SortQueryOperator.cs
- ListControlDesigner.cs
- ITreeGenerator.cs
- BooleanAnimationUsingKeyFrames.cs
- OneOfScalarConst.cs
- SemanticTag.cs
- XamlTypeMapper.cs
- EditorZoneAutoFormat.cs
- TraceHwndHost.cs
- SerializeAbsoluteContext.cs
- DefaultHttpHandler.cs
- EntitySetDataBindingList.cs
- Geometry.cs
- DataGridViewCellStyleChangedEventArgs.cs
- SubclassTypeValidatorAttribute.cs
- ScrollItemPattern.cs
- WorkflowInstance.cs
- EndOfStreamException.cs
- VSWCFServiceContractGenerator.cs
- AccessViolationException.cs
- CheckBox.cs
- Encoder.cs
- ContainerUtilities.cs
- DeclarativeExpressionConditionDeclaration.cs
- TemplateContainer.cs
- ChannelTokenTypeConverter.cs
- ListBase.cs
- XamlFigureLengthSerializer.cs
- EntityDataSourceColumn.cs
- DtdParser.cs
- ApplicationActivator.cs
- XsltOutput.cs
- FacetValues.cs
- VariantWrapper.cs
- MSAAWinEventWrap.cs
- CallSite.cs
- IEnumerable.cs
- InputLanguageProfileNotifySink.cs
- MetadataSource.cs
- SmtpLoginAuthenticationModule.cs
- HttpStreamXmlDictionaryReader.cs
- ProfileSettings.cs
- _DynamicWinsockMethods.cs
- LogLogRecordHeader.cs
- SortedDictionary.cs
- NativeMethods.cs
- WindowCollection.cs
- HostVisual.cs
- LightweightCodeGenerator.cs
- DescendantQuery.cs
- OutputScopeManager.cs
- HijriCalendar.cs
- DataTableMappingCollection.cs
- COMException.cs
- addressfiltermode.cs
- WindowsToolbar.cs
- RowUpdatedEventArgs.cs
- XomlDesignerLoader.cs
- contentDescriptor.cs
- ResXFileRef.cs
- XmlArrayAttribute.cs
- JsonReaderDelegator.cs
- QuaternionKeyFrameCollection.cs
- PackagingUtilities.cs
- NavigationWindowAutomationPeer.cs
- CustomAttributeFormatException.cs
- StructuralObject.cs
- GC.cs