Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / Stylus / StylusPointProperty.cs / 1305600 / 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
- PropertyInfo.cs
- SqlGenericUtil.cs
- StatusBarItem.cs
- CodeExporter.cs
- VisualBrush.cs
- InvalidPropValue.cs
- StandardToolWindows.cs
- Variant.cs
- GlyphManager.cs
- DoWorkEventArgs.cs
- XPathSelectionIterator.cs
- X509RecipientCertificateClientElement.cs
- Frame.cs
- SerializationInfoEnumerator.cs
- ContextMenuStripGroup.cs
- Action.cs
- Crc32Helper.cs
- DataSourceCache.cs
- XmlTextEncoder.cs
- DependencyProperty.cs
- ReadOnlyNameValueCollection.cs
- ContractCodeDomInfo.cs
- autovalidator.cs
- SupportsEventValidationAttribute.cs
- ToolStripPanelRow.cs
- BigInt.cs
- HierarchicalDataSourceControl.cs
- RoutedCommand.cs
- PcmConverter.cs
- XmlDocument.cs
- FilteredReadOnlyMetadataCollection.cs
- CapabilitiesSection.cs
- XmlSchema.cs
- DbConnectionStringBuilder.cs
- XsdBuilder.cs
- NativeMethodsCLR.cs
- dbdatarecord.cs
- Delegate.cs
- HtmlShimManager.cs
- MessageDecoder.cs
- AxHost.cs
- QuestionEventArgs.cs
- PersonalizationStateInfoCollection.cs
- StyleHelper.cs
- CharacterShapingProperties.cs
- AtomServiceDocumentSerializer.cs
- ModelServiceImpl.cs
- TreeNodeCollection.cs
- RepeatBehavior.cs
- UnauthorizedWebPart.cs
- DesignerActionMethodItem.cs
- DrawingServices.cs
- UdpTransportSettings.cs
- DataSourceCacheDurationConverter.cs
- SqlDataSourceCache.cs
- StandardTransformFactory.cs
- HierarchicalDataBoundControl.cs
- GradientBrush.cs
- IdentifierService.cs
- XmlAttributeCache.cs
- WebDisplayNameAttribute.cs
- BooleanAnimationUsingKeyFrames.cs
- DelegatingStream.cs
- _ListenerRequestStream.cs
- BufferedGraphicsManager.cs
- KeyToListMap.cs
- SqlNamer.cs
- ConfigPathUtility.cs
- XmlNodeList.cs
- SqlBuilder.cs
- ResourceProviderFactory.cs
- PublisherIdentityPermission.cs
- ServiceMetadataPublishingElement.cs
- SourceFileInfo.cs
- BitmapEffect.cs
- CodeArrayIndexerExpression.cs
- EndpointInstanceProvider.cs
- AppDomainCompilerProxy.cs
- ResourceManager.cs
- ProviderConnectionPointCollection.cs
- TextElement.cs
- DSACryptoServiceProvider.cs
- SchemaElementLookUpTableEnumerator.cs
- WebBrowserNavigatedEventHandler.cs
- x509utils.cs
- TreeNodeClickEventArgs.cs
- LinkArea.cs
- AutomationElementIdentifiers.cs
- ContractAdapter.cs
- DataDocumentXPathNavigator.cs
- RuleSet.cs
- SQlBooleanStorage.cs
- UnsafeNativeMethods.cs
- FontWeights.cs
- XmlSchemaAttributeGroupRef.cs
- ItemsControlAutomationPeer.cs
- NativeMethods.cs
- ToolboxComponentsCreatingEventArgs.cs
- ToolStripPanelRenderEventArgs.cs
- SqlFunctionAttribute.cs