Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- CodeArgumentReferenceExpression.cs
- ClientFormsIdentity.cs
- DrawingContextWalker.cs
- TextTreeText.cs
- DataGridViewCellFormattingEventArgs.cs
- MimeMultiPart.cs
- AuthorizationContext.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- VScrollProperties.cs
- PathParser.cs
- QuaternionConverter.cs
- XpsTokenContext.cs
- FragmentQuery.cs
- ApplicationDirectory.cs
- mediapermission.cs
- SwitchAttribute.cs
- OdbcConnectionOpen.cs
- SurrogateDataContract.cs
- DispatchWrapper.cs
- ServiceSettingsResponseInfo.cs
- Separator.cs
- SHA1.cs
- TextServicesHost.cs
- BufferBuilder.cs
- Blend.cs
- PassportAuthenticationEventArgs.cs
- ConnectivityStatus.cs
- DefaultProxySection.cs
- Helpers.cs
- ReadWriteObjectLock.cs
- SystemDiagnosticsSection.cs
- XmlMtomReader.cs
- NameValueCollection.cs
- Int64KeyFrameCollection.cs
- WindowsEditBoxRange.cs
- TypeDescriptor.cs
- ActivityExecutionContextCollection.cs
- httpstaticobjectscollection.cs
- BitVector32.cs
- DataGridViewLinkCell.cs
- FontConverter.cs
- PackagingUtilities.cs
- CodeVariableReferenceExpression.cs
- StringCollectionMarkupSerializer.cs
- ClaimTypes.cs
- AnimationTimeline.cs
- Translator.cs
- EnumMember.cs
- TdsParserSessionPool.cs
- TextSyndicationContent.cs
- DataIdProcessor.cs
- XmlSchemaSimpleType.cs
- SpellCheck.cs
- ValueSerializerAttribute.cs
- ImageDesigner.cs
- TableDetailsRow.cs
- ProviderConnectionPointCollection.cs
- QilDataSource.cs
- ImageAttributes.cs
- PixelShader.cs
- UserNameSecurityTokenProvider.cs
- CompoundFileReference.cs
- Vector.cs
- Resources.Designer.cs
- SslStream.cs
- ArithmeticException.cs
- FrameworkRichTextComposition.cs
- WebUtil.cs
- assemblycache.cs
- ColumnHeader.cs
- FontFamilyConverter.cs
- SystemThemeKey.cs
- InputLanguage.cs
- TextElement.cs
- HttpCapabilitiesBase.cs
- XmlSchemaAnyAttribute.cs
- CircleHotSpot.cs
- AsyncSerializedWorker.cs
- BroadcastEventHelper.cs
- LogExtent.cs
- HtmlElement.cs
- SemanticResolver.cs
- ElementUtil.cs
- DbDeleteCommandTree.cs
- FrameworkName.cs
- NotifyIcon.cs
- FrameworkTemplate.cs
- WorkflowTimerService.cs
- BinaryObjectWriter.cs
- WebWorkflowRole.cs
- ActivationArguments.cs
- Viewport3DVisual.cs
- ExceptQueryOperator.cs
- DrawingAttributeSerializer.cs
- PropertyCondition.cs
- XmlDeclaration.cs
- AsyncCallback.cs
- VarRemapper.cs
- OlePropertyStructs.cs
- TextEffect.cs