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
- CodeChecksumPragma.cs
- EdmItemError.cs
- ZipPackage.cs
- PieceNameHelper.cs
- MessageSecurityOverTcp.cs
- ScriptHandlerFactory.cs
- ArglessEventHandlerProxy.cs
- TextSpan.cs
- RootBrowserWindowAutomationPeer.cs
- RowParagraph.cs
- mediaeventshelper.cs
- ScrollPattern.cs
- TreeNodeBinding.cs
- AbsoluteQuery.cs
- DataBoundLiteralControl.cs
- SQlBooleanStorage.cs
- DesignerAttribute.cs
- XmlCountingReader.cs
- Documentation.cs
- ParenthesizePropertyNameAttribute.cs
- SourceLocation.cs
- DataTableNewRowEvent.cs
- QueryAsyncResult.cs
- TraceSwitch.cs
- SqlUdtInfo.cs
- DefinitionUpdate.cs
- JoinCqlBlock.cs
- PersonalizationProvider.cs
- TextRangeEditTables.cs
- ListContractAdapter.cs
- SortedDictionary.cs
- RegexFCD.cs
- Int32KeyFrameCollection.cs
- WebPartConnectionsCancelEventArgs.cs
- UnsafeNativeMethods.cs
- Transform3DGroup.cs
- PanelDesigner.cs
- Pair.cs
- MissingFieldException.cs
- StylusPointPropertyInfo.cs
- unsafenativemethodsother.cs
- DataGridViewElement.cs
- ToolConsole.cs
- UnsafeNativeMethods.cs
- unsafenativemethodstextservices.cs
- Button.cs
- StringValueConverter.cs
- XmlSchemaValidationException.cs
- AssemblyInfo.cs
- SystemTcpConnection.cs
- arc.cs
- ContextMenuAutomationPeer.cs
- EntityCommandExecutionException.cs
- CellTreeSimplifier.cs
- TranslateTransform3D.cs
- XmlEnumAttribute.cs
- PasswordRecovery.cs
- InternalCache.cs
- BinaryConverter.cs
- QueryPageSettingsEventArgs.cs
- CancellationHandler.cs
- WindowsListViewGroupSubsetLink.cs
- CustomErrorCollection.cs
- RequestCacheManager.cs
- BaseValidatorDesigner.cs
- WindowsListViewSubItem.cs
- WeakHashtable.cs
- ClientEndpointLoader.cs
- SessionParameter.cs
- QilXmlReader.cs
- WmlImageAdapter.cs
- VsPropertyGrid.cs
- ExceptionUtil.cs
- PrintPreviewDialog.cs
- BaseCollection.cs
- UMPAttributes.cs
- SamlDelegatingWriter.cs
- InstanceCreationEditor.cs
- ServiceReference.cs
- WebPartAddingEventArgs.cs
- SafeRightsManagementEnvironmentHandle.cs
- AdvancedBindingEditor.cs
- TypeUtil.cs
- WindowsStatusBar.cs
- metrodevice.cs
- Pair.cs
- PackUriHelper.cs
- SafePipeHandle.cs
- HealthMonitoringSection.cs
- MemberCollection.cs
- TemplateLookupAction.cs
- UnmanagedBitmapWrapper.cs
- BindingExpressionBase.cs
- ListDesigner.cs
- IERequestCache.cs
- ReadOnlyPropertyMetadata.cs
- TraceHelpers.cs
- UpDownEvent.cs
- SendKeys.cs
- ProxyWebPart.cs