Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Input / Stylus / StylusPointProperty.cs / 1 / StylusPointProperty.cs
//------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Input; using System.Globalization; using System.Windows.Media; using System.Collections.Generic; using SR = MS.Internal.PresentationCore.SR; using SRID = MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ////// StylusPointProperty /// public class StylusPointProperty { ////// Instance data /// private Guid _id; private bool _isButton; ////// StylusPointProperty /// /// identifier /// isButton public StylusPointProperty(Guid identifier, bool isButton) { Initialize(identifier, isButton); } ////// StylusPointProperty /// /// ///Protected - used by the StylusPointPropertyInfo ctor protected StylusPointProperty(StylusPointProperty stylusPointProperty) { if (null == stylusPointProperty) { throw new ArgumentNullException("stylusPointProperty"); } Initialize(stylusPointProperty.Id, stylusPointProperty.IsButton); } ////// Common ctor helper /// /// identifier /// isButton private void Initialize(Guid identifier, bool isButton) { // // validate isButton for known guids // if (StylusPointPropertyIds.IsKnownButton(identifier)) { if (!isButton) { //error, this is a known button throw new ArgumentException(SR.Get(SRID.InvalidIsButtonForId), "isButton"); } } else { if (StylusPointPropertyIds.IsKnownId(identifier) && isButton) { //error, this is a known guid that is NOT a button throw new ArgumentException(SR.Get(SRID.InvalidIsButtonForId2), "isButton"); } } _id = identifier; _isButton = isButton; } ////// Id /// public Guid Id { get { return _id; } } ////// IsButton /// public bool IsButton { get { return _isButton; } } ////// Returns a human readable string representation /// public override string ToString() { return "{Id=" + StylusPointPropertyIds.GetStringRepresentation(_id) + ", IsButton=" + _isButton.ToString(CultureInfo.InvariantCulture) + "}"; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Windows; using System.Windows.Input; using System.Globalization; using System.Windows.Media; using System.Collections.Generic; using SR = MS.Internal.PresentationCore.SR; using SRID = MS.Internal.PresentationCore.SRID; namespace System.Windows.Input { ////// StylusPointProperty /// public class StylusPointProperty { ////// Instance data /// private Guid _id; private bool _isButton; ////// StylusPointProperty /// /// identifier /// isButton public StylusPointProperty(Guid identifier, bool isButton) { Initialize(identifier, isButton); } ////// StylusPointProperty /// /// ///Protected - used by the StylusPointPropertyInfo ctor protected StylusPointProperty(StylusPointProperty stylusPointProperty) { if (null == stylusPointProperty) { throw new ArgumentNullException("stylusPointProperty"); } Initialize(stylusPointProperty.Id, stylusPointProperty.IsButton); } ////// Common ctor helper /// /// identifier /// isButton private void Initialize(Guid identifier, bool isButton) { // // validate isButton for known guids // if (StylusPointPropertyIds.IsKnownButton(identifier)) { if (!isButton) { //error, this is a known button throw new ArgumentException(SR.Get(SRID.InvalidIsButtonForId), "isButton"); } } else { if (StylusPointPropertyIds.IsKnownId(identifier) && isButton) { //error, this is a known guid that is NOT a button throw new ArgumentException(SR.Get(SRID.InvalidIsButtonForId2), "isButton"); } } _id = identifier; _isButton = isButton; } ////// Id /// public Guid Id { get { return _id; } } ////// IsButton /// public bool IsButton { get { return _isButton; } } ////// Returns a human readable string representation /// public override string ToString() { return "{Id=" + StylusPointPropertyIds.GetStringRepresentation(_id) + ", IsButton=" + _isButton.ToString(CultureInfo.InvariantCulture) + "}"; } } } // 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
- FlagsAttribute.cs
- NavigationCommands.cs
- TraceSection.cs
- ObjectComplexPropertyMapping.cs
- WebResourceAttribute.cs
- CheckBoxAutomationPeer.cs
- PropertyAccessVisitor.cs
- DeploymentSection.cs
- ExtendedPropertiesHandler.cs
- IndexedGlyphRun.cs
- BamlRecordReader.cs
- BitmapDecoder.cs
- WebPartMenu.cs
- EntryPointNotFoundException.cs
- DataStreams.cs
- PartialTrustVisibleAssembly.cs
- WebPartManagerInternals.cs
- XmlWriterTraceListener.cs
- ResolveNameEventArgs.cs
- FileEnumerator.cs
- PeerResolver.cs
- VirtualizedItemPattern.cs
- SecureConversationServiceElement.cs
- COAUTHINFO.cs
- StrokeNodeEnumerator.cs
- ContextMenuAutomationPeer.cs
- AnnotationResource.cs
- TypeGeneratedEventArgs.cs
- ApplicationException.cs
- ConstrainedDataObject.cs
- DupHandleConnectionReader.cs
- BinaryMethodMessage.cs
- XdrBuilder.cs
- BamlLocalizerErrorNotifyEventArgs.cs
- ComponentManagerBroker.cs
- MediaScriptCommandRoutedEventArgs.cs
- CompoundFileReference.cs
- InstanceStoreQueryResult.cs
- BrowsableAttribute.cs
- RegistrySecurity.cs
- CompositeControlDesigner.cs
- DefaultPropertyAttribute.cs
- BridgeDataReader.cs
- Expression.cs
- ObjectItemCollectionAssemblyCacheEntry.cs
- HostingEnvironmentWrapper.cs
- MetadataArtifactLoaderCompositeFile.cs
- PiiTraceSource.cs
- PenContexts.cs
- FormattedText.cs
- MappingItemCollection.cs
- Panel.cs
- TextTreeRootNode.cs
- TemplatedAdorner.cs
- TextEditorLists.cs
- XmlCDATASection.cs
- LinqMaximalSubtreeNominator.cs
- DocumentXPathNavigator.cs
- XsltConvert.cs
- IPAddressCollection.cs
- WindowsGraphicsWrapper.cs
- GPPOINTF.cs
- PropertyToken.cs
- CodeSnippetTypeMember.cs
- FragmentQuery.cs
- LinkUtilities.cs
- DocumentXPathNavigator.cs
- SafeRightsManagementHandle.cs
- SqlReferenceCollection.cs
- MissingFieldException.cs
- InheritanceAttribute.cs
- PrintPreviewDialog.cs
- KerberosSecurityTokenAuthenticator.cs
- WindowsFormsLinkLabel.cs
- StringUtil.cs
- EditorPartChrome.cs
- SyndicationSerializer.cs
- SecurityHelper.cs
- Sql8ConformanceChecker.cs
- InvariantComparer.cs
- XPathException.cs
- TableRowCollection.cs
- PropertyInfo.cs
- StringValidator.cs
- SelectionChangedEventArgs.cs
- Adorner.cs
- ReachSerializerAsync.cs
- ClientData.cs
- COM2IManagedPerPropertyBrowsingHandler.cs
- TimeSpan.cs
- Viewport2DVisual3D.cs
- DbConnectionPoolCounters.cs
- COM2DataTypeToManagedDataTypeConverter.cs
- EnglishPluralizationService.cs
- CacheChildrenQuery.cs
- DataPagerCommandEventArgs.cs
- BindingElementCollection.cs
- SessionIDManager.cs
- ADMembershipProvider.cs
- HtmlInputControl.cs