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
- InfoCardRSAOAEPKeyExchangeFormatter.cs
- ActivityExecutorOperation.cs
- CompilerState.cs
- SaveFileDialog.cs
- ReaderContextStackData.cs
- DiagnosticTraceSource.cs
- BlurBitmapEffect.cs
- ImageAnimator.cs
- WebPartConnectionsCancelVerb.cs
- EventOpcode.cs
- Mappings.cs
- CSharpCodeProvider.cs
- PassportAuthentication.cs
- SplitterPanel.cs
- ValidationErrorEventArgs.cs
- ScriptControl.cs
- CompatibleComparer.cs
- RoutedEventArgs.cs
- DataGridViewCellStyleBuilderDialog.cs
- SchemaCollectionPreprocessor.cs
- DashStyle.cs
- followingsibling.cs
- UTF8Encoding.cs
- FileDetails.cs
- ListItemsPage.cs
- QilInvokeEarlyBound.cs
- WindowsScrollBar.cs
- ZipIOExtraFieldElement.cs
- NameSpaceEvent.cs
- WindowPattern.cs
- ControlAdapter.cs
- SharedPersonalizationStateInfo.cs
- AutoResizedEvent.cs
- KoreanLunisolarCalendar.cs
- MethodAccessException.cs
- SafeUserTokenHandle.cs
- FileDialogCustomPlacesCollection.cs
- DetailsViewInsertEventArgs.cs
- securitycriticaldataClass.cs
- IndependentAnimationStorage.cs
- XmlSchemaAppInfo.cs
- TableParaClient.cs
- DataPagerFieldCommandEventArgs.cs
- ConvertEvent.cs
- Misc.cs
- ContextMenuAutomationPeer.cs
- Config.cs
- MetaData.cs
- PrintDialog.cs
- ClientType.cs
- ProgressBar.cs
- FixedLineResult.cs
- ErrorFormatter.cs
- OleTxTransaction.cs
- AutomationPatternInfo.cs
- OperatingSystem.cs
- TextProviderWrapper.cs
- ConsumerConnectionPointCollection.cs
- BrowserCapabilitiesFactory35.cs
- KnownBoxes.cs
- UInt32.cs
- BufferModesCollection.cs
- TableItemPatternIdentifiers.cs
- VisualTreeUtils.cs
- InternalMappingException.cs
- BackStopAuthenticationModule.cs
- validation.cs
- CacheModeValueSerializer.cs
- _UriTypeConverter.cs
- MessagePropertyVariants.cs
- ComboBoxAutomationPeer.cs
- SurrogateEncoder.cs
- Common.cs
- Overlapped.cs
- SystemBrushes.cs
- FontFamilyConverter.cs
- HebrewNumber.cs
- CallContext.cs
- MembershipSection.cs
- EntityDataSourceUtil.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- ACL.cs
- DropDownButton.cs
- TextBoxBase.cs
- XpsResourcePolicy.cs
- thaishape.cs
- ColumnMapCopier.cs
- TextRenderer.cs
- ItemCollection.cs
- KeyPressEvent.cs
- OleDbReferenceCollection.cs
- XmlSchemaSet.cs
- FileDialog_Vista.cs
- UserControlAutomationPeer.cs
- SecureStringHasher.cs
- OleDbMetaDataFactory.cs
- DesigntimeLicenseContext.cs
- AuthorizationRule.cs
- DocumentPageView.cs
- BamlTreeNode.cs