Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- AsymmetricKeyExchangeFormatter.cs
- RolePrincipal.cs
- FormsAuthenticationUserCollection.cs
- HiddenFieldPageStatePersister.cs
- XmlValidatingReaderImpl.cs
- QilGenerator.cs
- TemplateControl.cs
- documentsequencetextview.cs
- Geometry3D.cs
- PersonalizablePropertyEntry.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- ProxyManager.cs
- SecurityTokenException.cs
- DllHostedComPlusServiceHost.cs
- BeginStoryboard.cs
- DomainUpDown.cs
- ColumnResizeAdorner.cs
- XsdBuildProvider.cs
- CompositeCollectionView.cs
- ControlBuilder.cs
- PackageRelationshipSelector.cs
- SerializationHelper.cs
- GCHandleCookieTable.cs
- ReadWriteObjectLock.cs
- ProgressPage.cs
- StatusBar.cs
- WarningException.cs
- EncryptedPackageFilter.cs
- ImpersonateTokenRef.cs
- GenericQueueSurrogate.cs
- TreeView.cs
- SqlDataSourceCommandEventArgs.cs
- SiteMapNodeCollection.cs
- TaskExtensions.cs
- X509Chain.cs
- OperatingSystem.cs
- CompoundFileDeflateTransform.cs
- EntityDataSourceViewSchema.cs
- odbcmetadatacolumnnames.cs
- MDIControlStrip.cs
- BaseCAMarshaler.cs
- PathData.cs
- InfiniteIntConverter.cs
- FontUnitConverter.cs
- ZipPackage.cs
- CompilationRelaxations.cs
- formatter.cs
- NativeMethods.cs
- TextSimpleMarkerProperties.cs
- Canvas.cs
- HtmlTableRow.cs
- MetadataSource.cs
- FontFamilyIdentifier.cs
- SoapIgnoreAttribute.cs
- SecurityManager.cs
- FloaterBaseParaClient.cs
- EntityParameter.cs
- FrameworkContentElementAutomationPeer.cs
- DesignBindingPicker.cs
- MatrixTransform3D.cs
- JpegBitmapEncoder.cs
- InvalidProgramException.cs
- ReadOnlyMetadataCollection.cs
- DeferredSelectedIndexReference.cs
- VersionedStream.cs
- PageCodeDomTreeGenerator.cs
- ObjectConverter.cs
- WebBrowser.cs
- HttpGetProtocolReflector.cs
- AstTree.cs
- SymbolTable.cs
- TreeView.cs
- IgnoreFileBuildProvider.cs
- DriveInfo.cs
- DynamicValueConverter.cs
- AddInContractAttribute.cs
- FixedSOMLineRanges.cs
- KeyTime.cs
- ParserHooks.cs
- ChildTable.cs
- StrokeNodeOperations.cs
- Rotation3DAnimation.cs
- PackagingUtilities.cs
- CodeMemberMethod.cs
- GCHandleCookieTable.cs
- ProfilePropertySettingsCollection.cs
- ColumnMapCopier.cs
- Listbox.cs
- IdentifierCreationService.cs
- XomlCompiler.cs
- DiscoveryRequestHandler.cs
- NamedPipeAppDomainProtocolHandler.cs
- SimpleType.cs
- DetailsViewInsertEventArgs.cs
- AssemblyContextControlItem.cs
- XmlSchemaSet.cs
- SecurityDocument.cs
- VirtualizedContainerService.cs
- GlobalizationSection.cs
- FontSizeConverter.cs