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
- DbSourceCommand.cs
- TraceListeners.cs
- HwndAppCommandInputProvider.cs
- ToolStripContextMenu.cs
- Utilities.cs
- SqlExpressionNullability.cs
- CorrelationKey.cs
- RoleManagerModule.cs
- BrowserCapabilitiesFactory.cs
- ShapingWorkspace.cs
- HandledMouseEvent.cs
- FieldDescriptor.cs
- ZipIOExtraField.cs
- Positioning.cs
- CmsInterop.cs
- EnvelopedSignatureTransform.cs
- Variant.cs
- securitycriticaldataformultiplegetandset.cs
- RenderContext.cs
- ReadOnlyDictionary.cs
- DisposableCollectionWrapper.cs
- RangeValidator.cs
- WebPartDisplayModeEventArgs.cs
- FilterQuery.cs
- ComponentEvent.cs
- CuspData.cs
- ActivationArguments.cs
- DiagnosticStrings.cs
- sqlinternaltransaction.cs
- ZipIOLocalFileDataDescriptor.cs
- XamlParser.cs
- RectangleHotSpot.cs
- PartBasedPackageProperties.cs
- QueryCacheManager.cs
- PropertyEmitterBase.cs
- TcpProcessProtocolHandler.cs
- Trigger.cs
- RayHitTestParameters.cs
- WebBrowserProgressChangedEventHandler.cs
- InvalidProgramException.cs
- BaseDataListActionList.cs
- SymLanguageVendor.cs
- _SslSessionsCache.cs
- DataRowComparer.cs
- StrokeNodeOperations.cs
- PolicyLevel.cs
- InstanceDataCollectionCollection.cs
- DivideByZeroException.cs
- BaseTemplateCodeDomTreeGenerator.cs
- Matrix3DConverter.cs
- Decorator.cs
- Tuple.cs
- ContentHostHelper.cs
- SqlVersion.cs
- RootContext.cs
- Rect3D.cs
- HttpWebRequest.cs
- FlowDocumentReader.cs
- EventLogPermissionEntryCollection.cs
- RenderingEventArgs.cs
- SrgsRule.cs
- BuildDependencySet.cs
- MouseButtonEventArgs.cs
- Bitmap.cs
- Literal.cs
- GlobalizationAssembly.cs
- TextStore.cs
- ToolBarOverflowPanel.cs
- StringBuilder.cs
- PerfCounterSection.cs
- RequestTimeoutManager.cs
- PermissionListSet.cs
- PrinterResolution.cs
- VisualStyleRenderer.cs
- JumpTask.cs
- WindowsIdentity.cs
- CalendarAutoFormatDialog.cs
- SessionPageStateSection.cs
- MetaType.cs
- EventItfInfo.cs
- DataBoundControl.cs
- FormViewInsertedEventArgs.cs
- MSHTMLHost.cs
- CroppedBitmap.cs
- SqlProfileProvider.cs
- WorkflowOwnershipException.cs
- DefaultValueTypeConverter.cs
- TableProviderWrapper.cs
- StyleBamlRecordReader.cs
- WindowsTokenRoleProvider.cs
- InstanceDataCollectionCollection.cs
- TransformationRules.cs
- WriteTimeStream.cs
- ConfigDefinitionUpdates.cs
- ProfessionalColorTable.cs
- DataGridViewColumnConverter.cs
- VarInfo.cs
- FunctionNode.cs
- DefaultProxySection.cs
- FormViewUpdatedEventArgs.cs