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
- EditBehavior.cs
- DataGridViewCellStateChangedEventArgs.cs
- ElementUtil.cs
- SessionStateModule.cs
- PropertyMapper.cs
- Blend.cs
- OleDbCommand.cs
- MatcherBuilder.cs
- xmlsaver.cs
- SvcMapFileSerializer.cs
- TemplateField.cs
- CodeSubDirectoriesCollection.cs
- ScriptingJsonSerializationSection.cs
- SqlClientWrapperSmiStream.cs
- MemberInfoSerializationHolder.cs
- DeferredElementTreeState.cs
- HttpsHostedTransportConfiguration.cs
- _emptywebproxy.cs
- BaseHashHelper.cs
- DefaultClaimSet.cs
- XmlSignificantWhitespace.cs
- XamlPathDataSerializer.cs
- DiagnosticStrings.cs
- ConfigurationSectionGroup.cs
- PropertyManager.cs
- _ListenerAsyncResult.cs
- basemetadatamappingvisitor.cs
- SecurityHeader.cs
- CellTreeNodeVisitors.cs
- PrintPreviewDialog.cs
- SiteMapPathDesigner.cs
- MultiTrigger.cs
- CodeDomConfigurationHandler.cs
- DataControlFieldCollection.cs
- SafeNativeMethods.cs
- BooleanToSelectiveScrollingOrientationConverter.cs
- ColorConvertedBitmap.cs
- StorageEntitySetMapping.cs
- MonitoringDescriptionAttribute.cs
- SqlClientPermission.cs
- OdbcStatementHandle.cs
- _DisconnectOverlappedAsyncResult.cs
- RowTypePropertyElement.cs
- AttributeEmitter.cs
- SqlDataAdapter.cs
- ListViewItem.cs
- FlowDocumentPage.cs
- NativeCppClassAttribute.cs
- DiscoveryOperationContext.cs
- X500Name.cs
- BackgroundWorker.cs
- DataGridViewRowStateChangedEventArgs.cs
- RemotingServices.cs
- TemplateNameScope.cs
- SQLRoleProvider.cs
- IntegerValidatorAttribute.cs
- XpsResource.cs
- FileStream.cs
- handlecollector.cs
- CultureTableRecord.cs
- XmlTextReaderImplHelpers.cs
- ResourceManager.cs
- XmlIgnoreAttribute.cs
- NotifyInputEventArgs.cs
- SerialStream.cs
- PackageDocument.cs
- BCLDebug.cs
- EntityException.cs
- SignatureToken.cs
- WebHttpBinding.cs
- RegexRunnerFactory.cs
- TextHidden.cs
- DefaultTextStoreTextComposition.cs
- AddingNewEventArgs.cs
- HostingEnvironmentSection.cs
- IOThreadTimer.cs
- DynamicDocumentPaginator.cs
- ConfigurationStrings.cs
- FixedPosition.cs
- IProvider.cs
- StringHandle.cs
- DecoderBestFitFallback.cs
- TraceHandler.cs
- TextSelectionProcessor.cs
- ValueQuery.cs
- DotAtomReader.cs
- ExpandSegment.cs
- SafeFileMappingHandle.cs
- RoleBoolean.cs
- ProfileService.cs
- RegistrationServices.cs
- HttpCapabilitiesSectionHandler.cs
- TraceFilter.cs
- TrackingProfileDeserializationException.cs
- WebControlsSection.cs
- GestureRecognitionResult.cs
- ClrProviderManifest.cs
- RootBuilder.cs
- SimpleLine.cs
- CharStorage.cs