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
- SmtpClient.cs
- dtdvalidator.cs
- EventlogProvider.cs
- Hashtable.cs
- Span.cs
- StrongNamePublicKeyBlob.cs
- TextDecorations.cs
- FacetDescriptionElement.cs
- BackgroundWorker.cs
- OdbcFactory.cs
- InstanceKeyCollisionException.cs
- ObjectAssociationEndMapping.cs
- HwndHost.cs
- ConfigPathUtility.cs
- __TransparentProxy.cs
- RelatedCurrencyManager.cs
- BooleanAnimationBase.cs
- DrawingImage.cs
- QfeChecker.cs
- ValidationSummaryDesigner.cs
- DocumentPageHost.cs
- ThreadInterruptedException.cs
- ScaleTransform3D.cs
- RecognizedWordUnit.cs
- CompositeDataBoundControl.cs
- CatchDesigner.xaml.cs
- EventItfInfo.cs
- InputMethod.cs
- EditorPartChrome.cs
- BuildResult.cs
- PersonalizationEntry.cs
- WebPartChrome.cs
- VarRemapper.cs
- ActivityExecutionContextCollection.cs
- TagMapCollection.cs
- xml.cs
- TextTreeTextElementNode.cs
- SetStoryboardSpeedRatio.cs
- GlobalProxySelection.cs
- IsolationInterop.cs
- ProviderBase.cs
- CharUnicodeInfo.cs
- Environment.cs
- DataSourceCache.cs
- SHA1CryptoServiceProvider.cs
- FontEditor.cs
- EditorPart.cs
- _AcceptOverlappedAsyncResult.cs
- FixedSOMGroup.cs
- Win32MouseDevice.cs
- FactoryMaker.cs
- ProfilePropertyNameValidator.cs
- CodeAttributeArgument.cs
- HttpBrowserCapabilitiesBase.cs
- TraceHandlerErrorFormatter.cs
- ZipIOLocalFileHeader.cs
- BinaryConverter.cs
- Viewport3DAutomationPeer.cs
- PageAsyncTaskManager.cs
- XmlEventCache.cs
- TemplateXamlParser.cs
- streamingZipPartStream.cs
- TraceRecord.cs
- VerbConverter.cs
- HtmlInputControl.cs
- VisualState.cs
- ObjectDataSourceEventArgs.cs
- shaperfactoryquerycacheentry.cs
- XmlWrappingReader.cs
- MsmqException.cs
- Label.cs
- XmlSubtreeReader.cs
- Collection.cs
- GreenMethods.cs
- OpCopier.cs
- TabItemWrapperAutomationPeer.cs
- PrivilegeNotHeldException.cs
- DataGridViewEditingControlShowingEventArgs.cs
- SqlDependency.cs
- WebPartConnectionsCancelEventArgs.cs
- ZipIOModeEnforcingStream.cs
- BinaryObjectWriter.cs
- ItemsChangedEventArgs.cs
- StringCollection.cs
- PackWebResponse.cs
- SignatureDescription.cs
- DataViewSetting.cs
- DbProviderFactories.cs
- QueryContinueDragEvent.cs
- AssemblyAttributes.cs
- ReflectionUtil.cs
- DataGridColumnReorderingEventArgs.cs
- OutputCacheSection.cs
- BuildProvider.cs
- CodeCommentStatementCollection.cs
- MimeParameterWriter.cs
- DataKey.cs
- ISAPIWorkerRequest.cs
- ActionItem.cs
- Win32KeyboardDevice.cs