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
- XPathNavigatorException.cs
- WindowCollection.cs
- TypeSemantics.cs
- ObjectHelper.cs
- InheritanceContextChangedEventManager.cs
- UnauthorizedAccessException.cs
- TraceFilter.cs
- AssertFilter.cs
- TreeNodeStyleCollection.cs
- PersistenceTypeAttribute.cs
- WindowsTitleBar.cs
- MetricEntry.cs
- EditingMode.cs
- ColumnMapVisitor.cs
- InvalidDataException.cs
- AutomationTextAttribute.cs
- SelectionRangeConverter.cs
- FontFamilyConverter.cs
- PasswordPropertyTextAttribute.cs
- _UriTypeConverter.cs
- ValidatorUtils.cs
- ColorConverter.cs
- SoapSchemaImporter.cs
- Timer.cs
- XDRSchema.cs
- ValidationErrorInfo.cs
- ConstructorNeedsTagAttribute.cs
- SafeFileMappingHandle.cs
- BitmapEffectDrawingContextWalker.cs
- PartialTrustValidationBehavior.cs
- HierarchicalDataSourceControl.cs
- NavigationProgressEventArgs.cs
- _LocalDataStore.cs
- AutomationEvent.cs
- UseLicense.cs
- SmtpClient.cs
- Content.cs
- recordstate.cs
- HttpCachePolicy.cs
- dataSvcMapFileLoader.cs
- DataGridViewLinkColumn.cs
- COM2FontConverter.cs
- ObjectViewEntityCollectionData.cs
- OutputCacheSettingsSection.cs
- TableLayout.cs
- TraceXPathNavigator.cs
- DataGridViewBindingCompleteEventArgs.cs
- LinkedResource.cs
- SecureStringHasher.cs
- RegistrationServices.cs
- StringValidator.cs
- DbModificationCommandTree.cs
- MappingModelBuildProvider.cs
- ColorTransform.cs
- CLRBindingWorker.cs
- ApplicationDirectoryMembershipCondition.cs
- uribuilder.cs
- Win32SafeHandles.cs
- FixedBufferAttribute.cs
- TransactionOptions.cs
- EntityContainer.cs
- BStrWrapper.cs
- LookupBindingPropertiesAttribute.cs
- XmlArrayItemAttribute.cs
- WebBrowserEvent.cs
- Visual3DCollection.cs
- XmlLinkedNode.cs
- Codec.cs
- ProfileManager.cs
- OutputCacheProfileCollection.cs
- __Filters.cs
- ComponentSerializationService.cs
- SafeHGlobalHandleCritical.cs
- UiaCoreApi.cs
- PagedDataSource.cs
- EventMappingSettingsCollection.cs
- DiffuseMaterial.cs
- DataGridViewComboBoxColumn.cs
- ImageButton.cs
- TextDecorationUnitValidation.cs
- ExcCanonicalXml.cs
- SplayTreeNode.cs
- TimeManager.cs
- Button.cs
- SafeEventLogReadHandle.cs
- ObjectItemAttributeAssemblyLoader.cs
- Annotation.cs
- PauseStoryboard.cs
- SimpleType.cs
- FormsAuthenticationUser.cs
- PersonalizationProviderCollection.cs
- HtmlControl.cs
- SqlRecordBuffer.cs
- XmlCharCheckingWriter.cs
- UnknownWrapper.cs
- StrongTypingException.cs
- NameValuePermission.cs
- ChainOfDependencies.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- ContractsBCL.cs