Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / wpf / src / Core / CSharp / MS / Internal / Ink / StrokeNodeData.cs / 1 / 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
- TransformedBitmap.cs
- TypeCodeDomSerializer.cs
- MonthChangedEventArgs.cs
- Options.cs
- DelegateSerializationHolder.cs
- StatusBarItem.cs
- InputMethodStateTypeInfo.cs
- CompositeTypefaceMetrics.cs
- ItemChangedEventArgs.cs
- GridItemPattern.cs
- XmlLanguage.cs
- ByeMessage11.cs
- TimelineGroup.cs
- QilUnary.cs
- ExpandSegmentCollection.cs
- ToolStripArrowRenderEventArgs.cs
- DataGridViewColumnDesignTimeVisibleAttribute.cs
- OrderedDictionaryStateHelper.cs
- CryptoHelper.cs
- BulletedList.cs
- HtmlWindow.cs
- RijndaelManagedTransform.cs
- HttpCapabilitiesSectionHandler.cs
- UnsafeNativeMethods.cs
- ZipIOCentralDirectoryFileHeader.cs
- TreeNodeEventArgs.cs
- SharedPerformanceCounter.cs
- RowsCopiedEventArgs.cs
- ParseHttpDate.cs
- Ray3DHitTestResult.cs
- DataBindingList.cs
- ZipIOCentralDirectoryFileHeader.cs
- DataControlField.cs
- OracleDataReader.cs
- RandomNumberGenerator.cs
- CodeStatement.cs
- XmlSchemaComplexType.cs
- Clipboard.cs
- ClientFormsAuthenticationMembershipProvider.cs
- EventItfInfo.cs
- DefaultDialogButtons.cs
- UnmanagedBitmapWrapper.cs
- NamedElement.cs
- DataGrid.cs
- TemplateControl.cs
- DesignerTextViewAdapter.cs
- Calendar.cs
- OuterGlowBitmapEffect.cs
- WebScriptServiceHostFactory.cs
- HttpContext.cs
- ReflectionUtil.cs
- WmfPlaceableFileHeader.cs
- RoleExceptions.cs
- HuffmanTree.cs
- RichTextBox.cs
- UnsafeNativeMethods.cs
- _ContextAwareResult.cs
- login.cs
- Processor.cs
- DecoratedNameAttribute.cs
- Latin1Encoding.cs
- DataServiceQueryException.cs
- Profiler.cs
- DebuggerAttributes.cs
- BaseDataListComponentEditor.cs
- ImportOptions.cs
- Win32.cs
- ColorBlend.cs
- ImmComposition.cs
- CompilerInfo.cs
- ItemType.cs
- SourceFileBuildProvider.cs
- CharacterString.cs
- DataControlFieldCell.cs
- CommentEmitter.cs
- ProtocolsConfigurationHandler.cs
- MetadataSet.cs
- DataGridViewCellCancelEventArgs.cs
- LineVisual.cs
- XmlSchemaSimpleContentRestriction.cs
- EntityDescriptor.cs
- UserPreferenceChangingEventArgs.cs
- DbParameterHelper.cs
- RegistrySecurity.cs
- HScrollProperties.cs
- ApplicationManager.cs
- _UriTypeConverter.cs
- prefixendpointaddressmessagefilter.cs
- Int32AnimationBase.cs
- DataGridViewCellPaintingEventArgs.cs
- StorageEntitySetMapping.cs
- WorkflowQueueInfo.cs
- BlurBitmapEffect.cs
- WebScriptEnablingElement.cs
- SessionPageStateSection.cs
- ContractNamespaceAttribute.cs
- NodeFunctions.cs
- XmlQueryRuntime.cs
- PerfCounterSection.cs
- XhtmlTextWriter.cs