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
- ToolStripItemGlyph.cs
- GB18030Encoding.cs
- FtpWebResponse.cs
- ImmutablePropertyDescriptorGridEntry.cs
- ScriptControl.cs
- _HeaderInfoTable.cs
- ClickablePoint.cs
- RegularExpressionValidator.cs
- BuildResultCache.cs
- ProfileService.cs
- XmlDeclaration.cs
- BoundingRectTracker.cs
- SqlWorkflowPersistenceService.cs
- DelegatedStream.cs
- LayoutSettings.cs
- DialogResultConverter.cs
- TokenFactoryBase.cs
- Int16Animation.cs
- documentsequencetextpointer.cs
- ToolStripLocationCancelEventArgs.cs
- ComponentCache.cs
- MethodAccessException.cs
- MSAAWinEventWrap.cs
- XPathMultyIterator.cs
- DataBoundLiteralControl.cs
- _TLSstream.cs
- TypeKeyValue.cs
- XmlSchemaSimpleTypeList.cs
- Documentation.cs
- EventLogPermissionEntryCollection.cs
- NavigationPropertyEmitter.cs
- PropertyPathConverter.cs
- PopupControlService.cs
- StaticDataManager.cs
- ConfigurationPermission.cs
- mil_commands.cs
- HwndMouseInputProvider.cs
- NativeMethods.cs
- MD5CryptoServiceProvider.cs
- KeyNotFoundException.cs
- _ShellExpression.cs
- grammarelement.cs
- TextEditorContextMenu.cs
- BevelBitmapEffect.cs
- IgnoreDeviceFilterElementCollection.cs
- Substitution.cs
- BindingManagerDataErrorEventArgs.cs
- SystemIPAddressInformation.cs
- EntityTypeEmitter.cs
- Buffer.cs
- SortFieldComparer.cs
- RijndaelManaged.cs
- ThemeDictionaryExtension.cs
- DeviceSpecificChoice.cs
- _UriSyntax.cs
- AtomicFile.cs
- FontSourceCollection.cs
- ColorTranslator.cs
- ItemCollectionEditor.cs
- SkipStoryboardToFill.cs
- ProviderException.cs
- DbConnectionClosed.cs
- WorkflowRuntimeSection.cs
- GlyphingCache.cs
- Error.cs
- AutoScrollExpandMessageFilter.cs
- FixedFindEngine.cs
- CodeEventReferenceExpression.cs
- HostedBindingBehavior.cs
- ListView.cs
- PageHandlerFactory.cs
- TextServicesCompartmentEventSink.cs
- TimeSpanValidator.cs
- HtmlInputPassword.cs
- WindowsTooltip.cs
- EncryptedKeyHashIdentifierClause.cs
- Quad.cs
- EmptyCollection.cs
- TextCompositionManager.cs
- dsa.cs
- mediaeventargs.cs
- InitializationEventAttribute.cs
- ConfigXmlWhitespace.cs
- ResXDataNode.cs
- SendingRequestEventArgs.cs
- DbProviderFactoriesConfigurationHandler.cs
- SpellCheck.cs
- DecimalAverageAggregationOperator.cs
- ToggleButtonAutomationPeer.cs
- SoundPlayerAction.cs
- GridViewSortEventArgs.cs
- WriteFileContext.cs
- DeclarativeCatalogPart.cs
- WebPartHeaderCloseVerb.cs
- ReachDocumentSequenceSerializer.cs
- ProcessHostFactoryHelper.cs
- CompoundFileReference.cs
- MsmqEncryptionAlgorithm.cs
- SystemColors.cs
- EntityEntry.cs