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
- DelayedRegex.cs
- DirectoryNotFoundException.cs
- _SslSessionsCache.cs
- ReferentialConstraint.cs
- TitleStyle.cs
- BuilderPropertyEntry.cs
- DataGridAutoFormat.cs
- ICollection.cs
- CellParagraph.cs
- ResourceWriter.cs
- _Semaphore.cs
- ChannelSinkStacks.cs
- VersionPair.cs
- PassportIdentity.cs
- ColorConverter.cs
- basecomparevalidator.cs
- MatrixConverter.cs
- RunWorkerCompletedEventArgs.cs
- SocketAddress.cs
- SafeFindHandle.cs
- Aggregates.cs
- FileDialogCustomPlace.cs
- CustomBindingCollectionElement.cs
- EndPoint.cs
- OdbcUtils.cs
- AutomationPatternInfo.cs
- SpAudioStreamWrapper.cs
- FrameworkElementFactory.cs
- CommandLibraryHelper.cs
- RuleAttributes.cs
- ToolStripSystemRenderer.cs
- SortedList.cs
- RegexWorker.cs
- SystemIPInterfaceStatistics.cs
- MouseButton.cs
- TextSelectionProcessor.cs
- ToolStripPanelDesigner.cs
- MethodExpr.cs
- CacheDependency.cs
- DataGridSortCommandEventArgs.cs
- ObjectViewFactory.cs
- AppDomainProtocolHandler.cs
- TableHeaderCell.cs
- XmlDataSourceDesigner.cs
- PositiveTimeSpanValidator.cs
- PageParser.cs
- CacheRequest.cs
- LayoutSettings.cs
- TypeDescriptionProviderAttribute.cs
- TemplateField.cs
- UInt16.cs
- DataTableMappingCollection.cs
- MarginsConverter.cs
- RegistrationServices.cs
- RelationalExpressions.cs
- AsyncResult.cs
- ExpressionBuilderContext.cs
- SystemColorTracker.cs
- TextContainerChangedEventArgs.cs
- ScrollItemPatternIdentifiers.cs
- DecoderFallback.cs
- RequestCachePolicy.cs
- Polygon.cs
- SQLGuidStorage.cs
- SubMenuStyle.cs
- UInt32Converter.cs
- HttpFileCollection.cs
- SchemaCollectionPreprocessor.cs
- SHA256.cs
- CodeSnippetExpression.cs
- ResourcePart.cs
- Speller.cs
- CqlParserHelpers.cs
- DataGridViewIntLinkedList.cs
- LineSegment.cs
- OdbcConnectionFactory.cs
- ServicePointManagerElement.cs
- ToolBarButtonClickEvent.cs
- WebPartTransformer.cs
- StateMachine.cs
- Pair.cs
- FontInfo.cs
- RegionInfo.cs
- Descriptor.cs
- DocumentOrderComparer.cs
- XD.cs
- streamingZipPartStream.cs
- DataTransferEventArgs.cs
- ListSortDescriptionCollection.cs
- RectAnimationBase.cs
- InputLanguageManager.cs
- ElasticEase.cs
- StylusShape.cs
- Codec.cs
- CodeTypeReferenceSerializer.cs
- LoggedException.cs
- webbrowsersite.cs
- UniqueIdentifierService.cs
- PatternMatcher.cs
- XmlRawWriter.cs