Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / MS / Internal / Ink / StrokeNodeData.cs / 1305600 / StrokeNodeData.cs
//------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Windows; using System.Windows.Media; using System.Windows.Input; using System.Diagnostics; namespace MS.Internal.Ink { #region StrokeNodeData ////// This structure represents a node on a stroke spine. /// internal struct StrokeNodeData { #region Statics private static StrokeNodeData s_empty = new StrokeNodeData(); #endregion #region API (internal) ///Returns static object representing an unitialized node internal static StrokeNodeData Empty { get { return s_empty; } } ////// Constructor for nodes of a pressure insensitive stroke /// /// position of the node internal StrokeNodeData(Point position) { _position = position; _pressure = 1; } ////// Constructor for nodes with pressure data /// /// position of the node /// pressure scaling factor at the node internal StrokeNodeData(Point position, float pressure) { System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThan((double)pressure, 0d)); _position = position; _pressure = pressure; } ///Tells whether the structre was properly initialized internal bool IsEmpty { get { Debug.Assert(DoubleUtil.AreClose(0, s_empty._pressure)); return DoubleUtil.AreClose(_pressure, s_empty._pressure); } } ///Position of the node internal Point Position { get { return _position; } } ///Pressure scaling factor at the node internal float PressureFactor { get { return _pressure; } } #endregion #region Privates private Point _position; private float _pressure; #endregion } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------- using System; using System.Collections.Generic; using System.Windows; using System.Windows.Media; using System.Windows.Input; using System.Diagnostics; namespace MS.Internal.Ink { #region StrokeNodeData ////// This structure represents a node on a stroke spine. /// internal struct StrokeNodeData { #region Statics private static StrokeNodeData s_empty = new StrokeNodeData(); #endregion #region API (internal) ///Returns static object representing an unitialized node internal static StrokeNodeData Empty { get { return s_empty; } } ////// Constructor for nodes of a pressure insensitive stroke /// /// position of the node internal StrokeNodeData(Point position) { _position = position; _pressure = 1; } ////// Constructor for nodes with pressure data /// /// position of the node /// pressure scaling factor at the node internal StrokeNodeData(Point position, float pressure) { System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThan((double)pressure, 0d)); _position = position; _pressure = pressure; } ///Tells whether the structre was properly initialized internal bool IsEmpty { get { Debug.Assert(DoubleUtil.AreClose(0, s_empty._pressure)); return DoubleUtil.AreClose(_pressure, s_empty._pressure); } } ///Position of the node internal Point Position { get { return _position; } } ///Pressure scaling factor at the node internal float PressureFactor { get { return _pressure; } } #endregion #region Privates private Point _position; private float _pressure; #endregion } #endregion } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- PipelineModuleStepContainer.cs
- MonthCalendar.cs
- RemoteCryptoTokenProvider.cs
- CodeDOMUtility.cs
- HostingEnvironmentSection.cs
- MessageSmuggler.cs
- ExpandCollapseProviderWrapper.cs
- ChannelDispatcherCollection.cs
- HeaderCollection.cs
- AbandonedMutexException.cs
- StateBag.cs
- WebColorConverter.cs
- WebExceptionStatus.cs
- AccessDataSourceView.cs
- PrincipalPermission.cs
- ResourceKey.cs
- controlskin.cs
- ImpersonationContext.cs
- ButtonBase.cs
- IndentedWriter.cs
- WebConfigurationManager.cs
- LiteralTextParser.cs
- counter.cs
- SimplePropertyEntry.cs
- XPathNavigatorKeyComparer.cs
- TableItemStyle.cs
- ItemMap.cs
- MainMenu.cs
- Invariant.cs
- NonDualMessageSecurityOverHttp.cs
- _ServiceNameStore.cs
- WebPartCatalogAddVerb.cs
- DropAnimation.xaml.cs
- ParserHooks.cs
- CollectionBuilder.cs
- IxmlLineInfo.cs
- StreamHelper.cs
- DetailsView.cs
- PictureBox.cs
- XPathAncestorIterator.cs
- XmlSchemaAny.cs
- PackUriHelper.cs
- BlurBitmapEffect.cs
- DataObjectMethodAttribute.cs
- UIAgentAsyncParams.cs
- HttpPostProtocolReflector.cs
- HtmlInputImage.cs
- DropDownButton.cs
- Trace.cs
- WeakRefEnumerator.cs
- Matrix3DConverter.cs
- SAPICategories.cs
- ModelPerspective.cs
- DeferredElementTreeState.cs
- PreviewKeyDownEventArgs.cs
- SafeTimerHandle.cs
- PropertyValueChangedEvent.cs
- SingleAnimationBase.cs
- CodeFieldReferenceExpression.cs
- TreeViewItem.cs
- FormsAuthenticationUser.cs
- DataGridViewSelectedCellsAccessibleObject.cs
- CreatingCookieEventArgs.cs
- PropertyToken.cs
- EpmTargetPathSegment.cs
- OutputWindow.cs
- ReferenceService.cs
- Transform3D.cs
- FormatVersion.cs
- ScrollItemPatternIdentifiers.cs
- TreePrinter.cs
- Journal.cs
- ArrangedElementCollection.cs
- XComponentModel.cs
- NegationPusher.cs
- ConfigXmlDocument.cs
- SQLMembershipProvider.cs
- ContentDisposition.cs
- CompilationLock.cs
- FixedPage.cs
- InvalidOperationException.cs
- ComponentCollection.cs
- DiagnosticTraceSource.cs
- PolyBezierSegment.cs
- SignatureToken.cs
- ContainerParagraph.cs
- DataGridViewCellFormattingEventArgs.cs
- ObjectDataSourceEventArgs.cs
- ProtectedProviderSettings.cs
- StyleCollectionEditor.cs
- OracleTimeSpan.cs
- HtmlString.cs
- PopupRootAutomationPeer.cs
- VerificationAttribute.cs
- InheritanceAttribute.cs
- RequestQueryParser.cs
- CodeEventReferenceExpression.cs
- DataGridPagingPage.cs
- BlurBitmapEffect.cs
- SqlCaseSimplifier.cs