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 /// ///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 { ///////////////////////////////////////////////////////////////////////// /// name of the tablet /// 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 /// ///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. name of the tablet
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ExpressionWriter.cs
- WindowsTreeView.cs
- ListViewDeletedEventArgs.cs
- FastEncoder.cs
- RuntimeResourceSet.cs
- ValidationErrorCollection.cs
- BitmapEffectvisualstate.cs
- LocalizableResourceBuilder.cs
- ChildTable.cs
- WebMessageEncodingBindingElement.cs
- SeverityFilter.cs
- UnionQueryOperator.cs
- VectorCollectionValueSerializer.cs
- XsltArgumentList.cs
- ControlBindingsCollection.cs
- WizardStepBase.cs
- SoapReflectionImporter.cs
- HotSpot.cs
- SymbolDocumentGenerator.cs
- Section.cs
- MetadataFile.cs
- Bits.cs
- KerberosRequestorSecurityToken.cs
- RecommendedAsConfigurableAttribute.cs
- WebSysDisplayNameAttribute.cs
- FlowDocumentPaginator.cs
- IndentedWriter.cs
- RestClientProxyHandler.cs
- ErrorFormatter.cs
- SystemUnicastIPAddressInformation.cs
- IisTraceWebEventProvider.cs
- Bind.cs
- KnownBoxes.cs
- ComboBoxItem.cs
- ToolBarButtonDesigner.cs
- MasterPage.cs
- IteratorFilter.cs
- Int64KeyFrameCollection.cs
- DesignerHelpers.cs
- ComponentChangedEvent.cs
- PaginationProgressEventArgs.cs
- GreaterThan.cs
- DurableEnlistmentState.cs
- DataGridColumnCollectionEditor.cs
- LoginCancelEventArgs.cs
- BeginStoryboard.cs
- MetadataProperty.cs
- NumberFormatInfo.cs
- LinqDataSourceUpdateEventArgs.cs
- Parser.cs
- PolyLineSegment.cs
- TextServicesCompartmentContext.cs
- NativeMethods.cs
- ObjectDataSourceDisposingEventArgs.cs
- LoaderAllocator.cs
- WindowsTokenRoleProvider.cs
- UpdateProgress.cs
- XmlValueConverter.cs
- InvalidDataException.cs
- WindowsToolbarItemAsMenuItem.cs
- Int16.cs
- LongAverageAggregationOperator.cs
- FontStretch.cs
- ConfigXmlElement.cs
- CatchBlock.cs
- LayoutManager.cs
- DataStreamFromComStream.cs
- SystemResourceHost.cs
- BitmapData.cs
- BuildProvider.cs
- AutomationFocusChangedEventArgs.cs
- Assert.cs
- StringConcat.cs
- FieldNameLookup.cs
- FontDriver.cs
- SafeHandles.cs
- EncodingStreamWrapper.cs
- ImageMap.cs
- DataColumnCollection.cs
- RepeaterItemCollection.cs
- AttributeTable.cs
- BypassElementCollection.cs
- SimpleBitVector32.cs
- DiscardableAttribute.cs
- Comparer.cs
- FunctionDefinition.cs
- WebSysDescriptionAttribute.cs
- mediaclock.cs
- ThicknessKeyFrameCollection.cs
- PropertyEmitter.cs
- RelationshipDetailsRow.cs
- UriTemplate.cs
- DoubleLinkList.cs
- Columns.cs
- SqlTypeConverter.cs
- ManifestResourceInfo.cs
- XamlStream.cs
- SyndicationFeedFormatter.cs
- Misc.cs
- Number.cs