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
- SQlBooleanStorage.cs
- UrlAuthFailedErrorFormatter.cs
- TraceUtils.cs
- SmuggledIUnknown.cs
- CurrentChangingEventManager.cs
- ValueQuery.cs
- CredentialCache.cs
- CalculatedColumn.cs
- MappingSource.cs
- Resources.Designer.cs
- DesignerActionGlyph.cs
- ClientBuildManager.cs
- LiteralDesigner.cs
- URL.cs
- PackageProperties.cs
- CapabilitiesUse.cs
- ToolBar.cs
- CustomErrorsSectionWrapper.cs
- CultureMapper.cs
- TimeSpanOrInfiniteConverter.cs
- XPathDocument.cs
- DrawingAttributes.cs
- RepeatInfo.cs
- ReachSerializationUtils.cs
- MimeMultiPart.cs
- EncoderExceptionFallback.cs
- WebConfigurationHost.cs
- ItemCollection.cs
- COM2PictureConverter.cs
- DependencyPropertyConverter.cs
- StringKeyFrameCollection.cs
- ValidatingPropertiesEventArgs.cs
- ServiceErrorHandler.cs
- ObjectDataSourceStatusEventArgs.cs
- TouchesCapturedWithinProperty.cs
- ReverseComparer.cs
- VectorConverter.cs
- WebControlAdapter.cs
- MenuBase.cs
- FormViewPageEventArgs.cs
- Timer.cs
- WorkflowOperationBehavior.cs
- InvalidOperationException.cs
- OuterGlowBitmapEffect.cs
- RuntimeHandles.cs
- MsmqBindingMonitor.cs
- ThemeInfoAttribute.cs
- XmlSiteMapProvider.cs
- AsyncOperation.cs
- XmlSchemaAppInfo.cs
- ExceptionUtil.cs
- XmlTextReader.cs
- ProgressChangedEventArgs.cs
- ThreadAbortException.cs
- WeakReference.cs
- WorkflowMarkupSerializationManager.cs
- HttpWebRequest.cs
- ObjectDataSourceStatusEventArgs.cs
- TrackingValidationObjectDictionary.cs
- AssemblyUtil.cs
- DataObject.cs
- TreeNode.cs
- PeerEndPoint.cs
- HttpVersion.cs
- FrameDimension.cs
- objectresult_tresulttype.cs
- DataComponentNameHandler.cs
- ClientConfigurationHost.cs
- ReflectEventDescriptor.cs
- IdentityHolder.cs
- _BaseOverlappedAsyncResult.cs
- MaterializeFromAtom.cs
- ListViewUpdatedEventArgs.cs
- PerfCounters.cs
- WebConfigurationFileMap.cs
- WindowsImpersonationContext.cs
- DownloadProgressEventArgs.cs
- MemoryPressure.cs
- BitStack.cs
- DescriptionAttribute.cs
- FieldBuilder.cs
- WebPartsPersonalization.cs
- ActivityCodeDomSerializer.cs
- BaseTemplateParser.cs
- NumericUpDownAccelerationCollection.cs
- FrameworkReadOnlyPropertyMetadata.cs
- Base64Decoder.cs
- StylusButtonEventArgs.cs
- SoapAttributeOverrides.cs
- GcHandle.cs
- PagerStyle.cs
- MergeFilterQuery.cs
- SafeLibraryHandle.cs
- NTAccount.cs
- SqlNode.cs
- ToolStripStatusLabel.cs
- StrongNameMembershipCondition.cs
- RelatedImageListAttribute.cs
- DataProviderNameConverter.cs
- ImageUrlEditor.cs