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
- TextureBrush.cs
- ObjectDataSourceEventArgs.cs
- EditingMode.cs
- LineProperties.cs
- BoundField.cs
- MarkupCompiler.cs
- DataGridHeaderBorder.cs
- NameSpaceExtractor.cs
- ZipIOLocalFileHeader.cs
- FeatureAttribute.cs
- MatrixCamera.cs
- PhysicalOps.cs
- HyperLinkStyle.cs
- FaultDescriptionCollection.cs
- SoapFault.cs
- DataServiceHostWrapper.cs
- ParserExtension.cs
- ServerValidateEventArgs.cs
- FontSource.cs
- ConstraintStruct.cs
- EventPrivateKey.cs
- NodeCounter.cs
- Transform.cs
- GeometryHitTestResult.cs
- AndCondition.cs
- OperationResponse.cs
- ImmutableObjectAttribute.cs
- KeyedCollection.cs
- RoleManagerModule.cs
- DocComment.cs
- SchemaImporterExtensionElement.cs
- XPathNode.cs
- ItemMap.cs
- ToolStripItemTextRenderEventArgs.cs
- TerminatorSinks.cs
- webbrowsersite.cs
- TraceSection.cs
- LinkLabelLinkClickedEvent.cs
- AttributeQuery.cs
- StringHandle.cs
- SubpageParagraph.cs
- ColumnWidthChangedEvent.cs
- TypedLocationWrapper.cs
- StrokeFIndices.cs
- StringAnimationBase.cs
- XPathEmptyIterator.cs
- base64Transforms.cs
- SslSecurityTokenParameters.cs
- DrawingContextDrawingContextWalker.cs
- HandledEventArgs.cs
- UnsafeNetInfoNativeMethods.cs
- RectConverter.cs
- ClientScriptManager.cs
- HtmlEmptyTagControlBuilder.cs
- DispatcherExceptionFilterEventArgs.cs
- pingexception.cs
- CssStyleCollection.cs
- SqlDelegatedTransaction.cs
- ProfilePropertyNameValidator.cs
- Pair.cs
- EntityDataReader.cs
- HandlerBase.cs
- TableCellCollection.cs
- NumberAction.cs
- IsolatedStorageFile.cs
- DynamicResourceExtensionConverter.cs
- GeneralTransform2DTo3DTo2D.cs
- EventProvider.cs
- SizeIndependentAnimationStorage.cs
- CodeGeneratorOptions.cs
- AnimationLayer.cs
- ClosableStream.cs
- BitmapFrame.cs
- _FtpControlStream.cs
- XmlIterators.cs
- RangeValueProviderWrapper.cs
- CodeExpressionStatement.cs
- DurationConverter.cs
- TextBoxBase.cs
- TypeForwardedFromAttribute.cs
- documentsequencetextcontainer.cs
- HttpRequestTraceRecord.cs
- SamlSubjectStatement.cs
- _BasicClient.cs
- BitConverter.cs
- WebPartConnectionsCancelEventArgs.cs
- DetailsView.cs
- PersonalizationEntry.cs
- PropertyDescriptorCollection.cs
- TreeChangeInfo.cs
- RSAOAEPKeyExchangeFormatter.cs
- CapabilitiesPattern.cs
- DataSourceUtil.cs
- HwndSourceKeyboardInputSite.cs
- XmlSerializationReader.cs
- XmlDictionaryString.cs
- CompositionAdorner.cs
- Point3DKeyFrameCollection.cs
- MouseActionConverter.cs
- TextRangeAdaptor.cs