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
- MetafileHeader.cs
- ReverseComparer.cs
- WebServiceParameterData.cs
- OracleTimeSpan.cs
- WindowsFormsHost.cs
- ServiceObjectContainer.cs
- NetSectionGroup.cs
- WebPartCatalogCloseVerb.cs
- RecognizedWordUnit.cs
- DocumentEventArgs.cs
- PropertyValueChangedEvent.cs
- XAMLParseException.cs
- EllipseGeometry.cs
- InstanceDataCollectionCollection.cs
- FormatterServices.cs
- CompletionCallbackWrapper.cs
- PriorityChain.cs
- ConfigurationManagerInternalFactory.cs
- ComponentSerializationService.cs
- ImportFileRequest.cs
- DbConnectionFactory.cs
- SecurityUniqueId.cs
- BitmapEffectrendercontext.cs
- ListViewEditEventArgs.cs
- LocatorGroup.cs
- odbcmetadatacollectionnames.cs
- WorkflowWebHostingModule.cs
- HandleCollector.cs
- HTMLTextWriter.cs
- RenderingEventArgs.cs
- SoapObjectWriter.cs
- WindowsTab.cs
- EntityParameterCollection.cs
- DesignTimeParseData.cs
- NegotiateStream.cs
- SessionStateSection.cs
- SoapServerProtocol.cs
- Table.cs
- DoubleIndependentAnimationStorage.cs
- XamlGridLengthSerializer.cs
- XmlQueryCardinality.cs
- TextServicesPropertyRanges.cs
- SqlDataReader.cs
- KnownTypesHelper.cs
- CodeDirectoryCompiler.cs
- Reference.cs
- CursorInteropHelper.cs
- CodeIdentifiers.cs
- CustomValidator.cs
- TemplatePartAttribute.cs
- PolygonHotSpot.cs
- SingleQueryOperator.cs
- Double.cs
- MaskedTextProvider.cs
- ConditionCollection.cs
- NetCodeGroup.cs
- BufferBuilder.cs
- RuleInfoComparer.cs
- Form.cs
- SqlTypesSchemaImporter.cs
- PerformanceCounter.cs
- MobileRedirect.cs
- PolicyValidator.cs
- PageParser.cs
- TextTreeTextElementNode.cs
- MethodExpr.cs
- CompModSwitches.cs
- Screen.cs
- StateBag.cs
- MimeObjectFactory.cs
- BitmapDecoder.cs
- Stacktrace.cs
- TextParaLineResult.cs
- ExpressionServices.cs
- Mutex.cs
- ImageSourceConverter.cs
- HttpListenerElement.cs
- DescendantQuery.cs
- PolyQuadraticBezierSegment.cs
- IxmlLineInfo.cs
- TextElementEnumerator.cs
- DesignOnlyAttribute.cs
- TextTreeInsertUndoUnit.cs
- formatter.cs
- WebPartDescription.cs
- ScrollBar.cs
- PersonalizationStateInfoCollection.cs
- ScriptingAuthenticationServiceSection.cs
- IntranetCredentialPolicy.cs
- SymmetricAlgorithm.cs
- ImageListStreamer.cs
- Comparer.cs
- CollectionContainer.cs
- AdapterUtil.cs
- MediaPlayerState.cs
- GeneratedContractType.cs
- CheckBoxAutomationPeer.cs
- MemoryMappedViewStream.cs
- BindingManagerDataErrorEventArgs.cs
- SelectionList.cs