Code:
/ DotNET / DotNET / 8.0 / untmp / WIN_WINDOWS / lh_tools_devdiv_wpf / Windows / wcp / Core / System / Windows / Input / Stylus / StylusPointPropertyInfo.cs / 1 / StylusPointPropertyInfo.cs
//------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Input; using System.Windows.Media; using System.Collections.Generic; using System.Diagnostics; using System.ComponentModel; using MS.Utility; using SR = MS.Internal.PresentationCore.SR; using SRID = MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ////// StylusPointPropertyInfo /// public class StylusPointPropertyInfo : StylusPointProperty { ////// Instance data /// private int _min; private int _max; private float _resolution; private StylusPointPropertyUnit _unit; ////// For a given StylusPointProperty, instantiates a StylusPointPropertyInfo with default values /// /// public StylusPointPropertyInfo(StylusPointProperty stylusPointProperty) : base (stylusPointProperty) //base checks for null { StylusPointPropertyInfo info = StylusPointPropertyInfoDefaults.GetStylusPointPropertyInfoDefault(stylusPointProperty); _min = info.Minimum; _max = info.Maximum; _resolution = info.Resolution; _unit = info.Unit; } ////// StylusPointProperty /// /// /// minimum /// maximum /// unit /// resolution public StylusPointPropertyInfo(StylusPointProperty stylusPointProperty, int minimum, int maximum, StylusPointPropertyUnit unit, float resolution) : base(stylusPointProperty) //base checks for null { // validate unit if (!StylusPointPropertyUnitHelper.IsDefined(unit)) { throw new InvalidEnumArgumentException("StylusPointPropertyUnit", (int)unit, typeof(StylusPointPropertyUnit)); } // validate min/max if (maximum < minimum) { throw new ArgumentException(SR.Get(SRID.Stylus_InvalidMax), "maximum"); } // validate resolution if (resolution < 0.0f) { throw new ArgumentException(SR.Get(SRID.InvalidStylusPointPropertyInfoResolution), "resolution"); } _min = minimum; _max = maximum; _resolution = resolution; _unit = unit; } ////// Minimum /// public int Minimum { get { return _min; } } ////// Maximum /// public int Maximum { get { return _max; } } ////// Resolution /// public float Resolution { get { return _resolution; } } ////// Unit /// public StylusPointPropertyUnit Unit { get { return _unit; } } ////// Internal helper method for comparing compat for two StylusPointPropertyInfos /// internal static bool AreCompatible(StylusPointPropertyInfo stylusPointPropertyInfo1, StylusPointPropertyInfo stylusPointPropertyInfo2) { if (stylusPointPropertyInfo1 == null || stylusPointPropertyInfo2 == null) { throw new ArgumentNullException("stylusPointPropertyInfo"); } Debug.Assert(( stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X && stylusPointPropertyInfo1.Id != StylusPointPropertyIds.Y && stylusPointPropertyInfo2.Id != StylusPointPropertyIds.X && stylusPointPropertyInfo2.Id != StylusPointPropertyIds.Y), "Why are you checking X, Y for compatibility? They're always compatible"); // // we only take ID and IsButton into account, we don't take metrics into account // return (stylusPointPropertyInfo1.Id == stylusPointPropertyInfo2.Id && stylusPointPropertyInfo1.IsButton == stylusPointPropertyInfo2.IsButton); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- Visitors.cs
- DateTimeFormat.cs
- XmlSerializerSection.cs
- DataObjectAttribute.cs
- MultiBindingExpression.cs
- FontFamilyConverter.cs
- UnmanagedHandle.cs
- DataColumnCollection.cs
- DataTable.cs
- SafeMILHandle.cs
- DesignerRegionMouseEventArgs.cs
- DbProviderServices.cs
- TransactionWaitAsyncResult.cs
- ProgressPage.cs
- PrePrepareMethodAttribute.cs
- ToolBarButton.cs
- MobileControl.cs
- CanonicalXml.cs
- QueryInterceptorAttribute.cs
- BatchParser.cs
- SoapAttributes.cs
- DiscoveryClientChannelBase.cs
- PageCache.cs
- LogFlushAsyncResult.cs
- ResourceExpressionBuilder.cs
- CheckableControlBaseAdapter.cs
- Interlocked.cs
- SymbolTable.cs
- Variable.cs
- DesignTimeData.cs
- SharedStatics.cs
- AdornerPresentationContext.cs
- DataViewManager.cs
- HostingEnvironmentSection.cs
- Substitution.cs
- PropertyChangedEventArgs.cs
- SecurityResources.cs
- _TransmitFileOverlappedAsyncResult.cs
- OuterProxyWrapper.cs
- RoutedEventHandlerInfo.cs
- ListViewCommandEventArgs.cs
- ListSortDescription.cs
- PathSegmentCollection.cs
- TrackPoint.cs
- SystemIPv4InterfaceProperties.cs
- ContractReference.cs
- InvalidProgramException.cs
- SqlHelper.cs
- AssemblyFilter.cs
- InternalTypeHelper.cs
- sqlstateclientmanager.cs
- Module.cs
- SettingsSection.cs
- XmlNodeReader.cs
- FactoryGenerator.cs
- Logging.cs
- Odbc32.cs
- UiaCoreApi.cs
- DataReceivedEventArgs.cs
- Context.cs
- SequenceDesignerAccessibleObject.cs
- AsyncCallback.cs
- DrawingCollection.cs
- WebPartDescription.cs
- MemberProjectedSlot.cs
- Msec.cs
- XmlSchemaGroupRef.cs
- DataRowComparer.cs
- WebBrowserNavigatedEventHandler.cs
- ZipIOCentralDirectoryDigitalSignature.cs
- TransactionCache.cs
- PageWrapper.cs
- SharedDp.cs
- HtmlTableCellCollection.cs
- FrameSecurityDescriptor.cs
- TextBoxView.cs
- ConfigurationStrings.cs
- SqlServices.cs
- DatagridviewDisplayedBandsData.cs
- InputBindingCollection.cs
- XmlDataSourceDesigner.cs
- ObjectDataSourceSelectingEventArgs.cs
- FlatButtonAppearance.cs
- DataColumn.cs
- SecurityTokenRequirement.cs
- TextHidden.cs
- ConfigurationLocation.cs
- WebServiceEnumData.cs
- ProgressBarAutomationPeer.cs
- RoleManagerEventArgs.cs
- XmlSequenceWriter.cs
- MarshalByRefObject.cs
- ServiceProviders.cs
- LassoSelectionBehavior.cs
- DocComment.cs
- DoubleAnimationUsingKeyFrames.cs
- DesignerWebPartChrome.cs
- XmlEncoding.cs
- XDRSchema.cs
- BroadcastEventHelper.cs