Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Input / Stylus / StylusButton.cs / 1305600 / StylusButton.cs
using System;
using System.Globalization;
namespace System.Windows.Input
{
/////////////////////////////////////////////////////////////////////////
///
/// StylusButton class
///
public class StylusButton
{
/////////////////////////////////////////////////////////////////////
internal StylusButton(string name, Guid id)
{
_name = name;
_guid = id;
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the hardware Guid of the StylusDevice button.
///
public Guid Guid
{
get
{
return _guid;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the current state of the button.
///
public StylusButtonState StylusButtonState
{
//
get
{
StylusPointCollection stylusPoints = StylusDevice.GetStylusPoints(null);
if (stylusPoints == null || stylusPoints.Count == 0)
return CachedButtonState;
return (StylusButtonState)stylusPoints[stylusPoints.Count - 1].GetPropertyValue(new StylusPointProperty(Guid, true));
}
}
internal StylusButtonState CachedButtonState
{
get
{
return _cachedButtonState;
}
set
{
_cachedButtonState = value;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the name of the button.
///
public string Name
{
get
{
return _name;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns StylusDevice object that owns this button.
///
public StylusDevice StylusDevice
{
get
{
return _stylusDevice;
}
}
/////////////////////////////////////////////////////////////////////
///
internal void SetOwner(StylusDevice stylusDevice)
{
_stylusDevice = stylusDevice;
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the friendly representation of the button object
///
/// name of the tablet
public override string ToString()
{
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), this.Name);
}
/////////////////////////////////////////////////////////////////////
StylusDevice _stylusDevice;
string _name;
Guid _guid;
StylusButtonState _cachedButtonState = StylusButtonState.Up;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
using System;
using System.Globalization;
namespace System.Windows.Input
{
/////////////////////////////////////////////////////////////////////////
///
/// StylusButton class
///
public class StylusButton
{
/////////////////////////////////////////////////////////////////////
internal StylusButton(string name, Guid id)
{
_name = name;
_guid = id;
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the hardware Guid of the StylusDevice button.
///
public Guid Guid
{
get
{
return _guid;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the current state of the button.
///
public StylusButtonState StylusButtonState
{
//
get
{
StylusPointCollection stylusPoints = StylusDevice.GetStylusPoints(null);
if (stylusPoints == null || stylusPoints.Count == 0)
return CachedButtonState;
return (StylusButtonState)stylusPoints[stylusPoints.Count - 1].GetPropertyValue(new StylusPointProperty(Guid, true));
}
}
internal StylusButtonState CachedButtonState
{
get
{
return _cachedButtonState;
}
set
{
_cachedButtonState = value;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the name of the button.
///
public string Name
{
get
{
return _name;
}
}
/////////////////////////////////////////////////////////////////////
///
/// Returns StylusDevice object that owns this button.
///
public StylusDevice StylusDevice
{
get
{
return _stylusDevice;
}
}
/////////////////////////////////////////////////////////////////////
///
internal void SetOwner(StylusDevice stylusDevice)
{
_stylusDevice = stylusDevice;
}
/////////////////////////////////////////////////////////////////////
///
/// Returns the friendly representation of the button object
///
/// name of the tablet
public override string ToString()
{
return String.Format(CultureInfo.CurrentCulture, "{0}({1})", base.ToString(), this.Name);
}
/////////////////////////////////////////////////////////////////////
StylusDevice _stylusDevice;
string _name;
Guid _guid;
StylusButtonState _cachedButtonState = StylusButtonState.Up;
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WmiEventSink.cs
- DesignerCatalogPartChrome.cs
- LayoutEvent.cs
- Int32Storage.cs
- HierarchicalDataBoundControl.cs
- AssemblyGen.cs
- MultiViewDesigner.cs
- PaperSource.cs
- XmlTextAttribute.cs
- MultitargetingHelpers.cs
- ToolboxItem.cs
- XmlNodeList.cs
- FileUpload.cs
- EntityDataSourceViewSchema.cs
- GridErrorDlg.cs
- PictureBox.cs
- DocComment.cs
- ApplicationDirectoryMembershipCondition.cs
- RotateTransform3D.cs
- WebServicesSection.cs
- PrtTicket_Public.cs
- ResXBuildProvider.cs
- CssClassPropertyAttribute.cs
- UnsafeNetInfoNativeMethods.cs
- VirtualPath.cs
- HttpBufferlessInputStream.cs
- AdapterUtil.cs
- SystemGatewayIPAddressInformation.cs
- EndCreateSecurityTokenRequest.cs
- PrtTicket_Base.cs
- GeometryDrawing.cs
- FlowDocumentView.cs
- VisualBasicSettings.cs
- CDSsyncETWBCLProvider.cs
- CompositionTarget.cs
- StaticFileHandler.cs
- CodeLinePragma.cs
- GroupQuery.cs
- XmlNotation.cs
- ServerValidateEventArgs.cs
- SqlUdtInfo.cs
- PrintDocument.cs
- TableChangeProcessor.cs
- FormViewInsertedEventArgs.cs
- SafeNativeMethods.cs
- VersionedStreamOwner.cs
- TextSearch.cs
- ICspAsymmetricAlgorithm.cs
- TreeNodeCollection.cs
- ZoneIdentityPermission.cs
- Array.cs
- ByteStorage.cs
- NavigateUrlConverter.cs
- TraceSwitch.cs
- ProfileGroupSettings.cs
- ValueExpressions.cs
- MenuItemCollection.cs
- XmlReaderSettings.cs
- __FastResourceComparer.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- ImageMap.cs
- DataGridParentRows.cs
- AsymmetricKeyExchangeFormatter.cs
- FactoryGenerator.cs
- TimeSpanConverter.cs
- AutoResetEvent.cs
- ListChangedEventArgs.cs
- ToolStripSplitButton.cs
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- CategoryValueConverter.cs
- Matrix3DConverter.cs
- SqlBuffer.cs
- RecordManager.cs
- CodeEventReferenceExpression.cs
- SupportingTokenParameters.cs
- ConfigXmlDocument.cs
- ImageInfo.cs
- DesignerSerializationOptionsAttribute.cs
- ISessionStateStore.cs
- SafeNativeMethodsCLR.cs
- PropertyInfoSet.cs
- ListViewItemEventArgs.cs
- TreeView.cs
- SystemException.cs
- NullableDoubleAverageAggregationOperator.cs
- CqlGenerator.cs
- XmlAtomicValue.cs
- DecimalConverter.cs
- OutgoingWebRequestContext.cs
- WebScriptEndpoint.cs
- JoinTreeNode.cs
- RegisteredExpandoAttribute.cs
- SimpleRecyclingCache.cs
- nulltextcontainer.cs
- XmlSignatureProperties.cs
- HttpHandlersSection.cs
- FixedTextBuilder.cs
- DocumentScope.cs
- CompositeFontInfo.cs
- MobileResource.cs