Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / Orcas / NetFXw7 / wpf / src / Core / CSharp / System / Windows / Media / LineSegment.cs / 1 / LineSegment.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: LineSegment.cs //----------------------------------------------------------------------------- using System; using MS.Internal; using MS.Internal.PresentationCore; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Collections; using System.Text; using System.Globalization; using System.Windows.Media; using System.Windows; using System.Text.RegularExpressions; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Diagnostics; using System.Security; using System.Security.Permissions; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// LineSegment /// public sealed partial class LineSegment : PathSegment { #region Constructors ////// /// public LineSegment() { } ////// /// public LineSegment(Point point, bool isStroked) { Point = point; IsStroked = isStroked; } // Internal constructor supporting smooth joins between segments internal LineSegment(Point point, bool isStroked, bool isSmoothJoin) { Point = point; IsStroked = isStroked; IsSmoothJoin = isSmoothJoin; } #endregion #region AddToFigure internal override void AddToFigure( Matrix matrix, // The transformation matrid PathFigure figure, // The figure to add to ref Point current) // Out: Segment endpoint, not transformed { current = Point; if (matrix.IsIdentity) { figure.Segments.Add(this); } else { Point pt = current; pt *= matrix; figure.Segments.Add(new LineSegment(pt, IsStroked, IsSmoothJoin)); } } #endregion ////// SerializeData - Serialize the contents of this Segment to the provided context. /// internal override void SerializeData(StreamGeometryContext ctx) { ctx.LineTo(Point, IsStroked, IsSmoothJoin); } internal override bool IsCurved() { return false; } ////// Creates a string representation of this object based on the format string /// and IFormatProvider passed in. /// If the provider is null, the CurrentCulture is used. /// See the documentation for IFormattable for more information. /// ////// A string representation of this object. /// internal override string ConvertToString(string format, IFormatProvider provider) { return "L" + ((IFormattable)Point).ToString(format, provider); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: LineSegment.cs //----------------------------------------------------------------------------- using System; using MS.Internal; using MS.Internal.PresentationCore; using System.ComponentModel; using System.ComponentModel.Design.Serialization; using System.Reflection; using System.Collections; using System.Text; using System.Globalization; using System.Windows.Media; using System.Windows; using System.Text.RegularExpressions; using System.Windows.Media.Animation; using System.Windows.Media.Composition; using System.Diagnostics; using System.Security; using System.Security.Permissions; using SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// LineSegment /// public sealed partial class LineSegment : PathSegment { #region Constructors ////// /// public LineSegment() { } ////// /// public LineSegment(Point point, bool isStroked) { Point = point; IsStroked = isStroked; } // Internal constructor supporting smooth joins between segments internal LineSegment(Point point, bool isStroked, bool isSmoothJoin) { Point = point; IsStroked = isStroked; IsSmoothJoin = isSmoothJoin; } #endregion #region AddToFigure internal override void AddToFigure( Matrix matrix, // The transformation matrid PathFigure figure, // The figure to add to ref Point current) // Out: Segment endpoint, not transformed { current = Point; if (matrix.IsIdentity) { figure.Segments.Add(this); } else { Point pt = current; pt *= matrix; figure.Segments.Add(new LineSegment(pt, IsStroked, IsSmoothJoin)); } } #endregion ////// SerializeData - Serialize the contents of this Segment to the provided context. /// internal override void SerializeData(StreamGeometryContext ctx) { ctx.LineTo(Point, IsStroked, IsSmoothJoin); } internal override bool IsCurved() { return false; } ////// Creates a string representation of this object based on the format string /// and IFormatProvider passed in. /// If the provider is null, the CurrentCulture is used. /// See the documentation for IFormattable for more information. /// ////// A string representation of this object. /// internal override string ConvertToString(string format, IFormatProvider provider) { return "L" + ((IFormattable)Point).ToString(format, provider); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- ArcSegment.cs
- ButtonBaseAdapter.cs
- AuthenticationServiceManager.cs
- ConsumerConnectionPoint.cs
- EmbossBitmapEffect.cs
- OracleConnectionStringBuilder.cs
- CodeChecksumPragma.cs
- TransactionProtocol.cs
- TraceEventCache.cs
- GetBrowserTokenRequest.cs
- _ChunkParse.cs
- EventLogger.cs
- ObjectViewEntityCollectionData.cs
- DataSourceProvider.cs
- MarkupObject.cs
- PropertyBuilder.cs
- Int64AnimationBase.cs
- EntityStoreSchemaGenerator.cs
- CallbackHandler.cs
- ClientSettingsProvider.cs
- StylusPointProperties.cs
- DateRangeEvent.cs
- SizeFConverter.cs
- TextElementCollection.cs
- EffectiveValueEntry.cs
- VisualTransition.cs
- SmiEventStream.cs
- ObjectQueryExecutionPlan.cs
- PointIndependentAnimationStorage.cs
- AttributeEmitter.cs
- SqlServer2KCompatibilityAnnotation.cs
- BitmapEffectInput.cs
- DefaultValueConverter.cs
- PtsCache.cs
- SupportsEventValidationAttribute.cs
- SqlRowUpdatingEvent.cs
- RuleSettings.cs
- ListViewCancelEventArgs.cs
- ReservationNotFoundException.cs
- HttpModuleActionCollection.cs
- ObjectListShowCommandsEventArgs.cs
- WSHttpBindingBaseElement.cs
- SRGSCompiler.cs
- GeometryValueSerializer.cs
- Pts.cs
- TagPrefixAttribute.cs
- Quaternion.cs
- HyperLinkStyle.cs
- Timeline.cs
- ResourceFallbackManager.cs
- AuthenticationServiceManager.cs
- NamespaceMapping.cs
- CfgParser.cs
- VisualStyleInformation.cs
- JpegBitmapEncoder.cs
- GradientStop.cs
- WorkflowQueue.cs
- GraphicsState.cs
- EntitySqlQueryBuilder.cs
- WizardSideBarListControlItemEventArgs.cs
- AsyncPostBackTrigger.cs
- RTLAwareMessageBox.cs
- FilterQuery.cs
- DataGridViewTopLeftHeaderCell.cs
- AnyReturnReader.cs
- documentsequencetextcontainer.cs
- DataGridViewRowCancelEventArgs.cs
- MonitoringDescriptionAttribute.cs
- HybridDictionary.cs
- XmlSchemaSimpleContent.cs
- Table.cs
- DataSourceCache.cs
- ColumnReorderedEventArgs.cs
- TextMessageEncodingBindingElement.cs
- EventLogger.cs
- PageParserFilter.cs
- ArrayExtension.cs
- ModifierKeysConverter.cs
- PerfCounters.cs
- TypeListConverter.cs
- embossbitmapeffect.cs
- NonBatchDirectoryCompiler.cs
- XmlSchemaComplexContentExtension.cs
- Registry.cs
- OleDbConnectionInternal.cs
- StrongName.cs
- InheritanceUI.cs
- DataGridColumnHeaderAutomationPeer.cs
- UserPreference.cs
- UserControl.cs
- XmlAutoDetectWriter.cs
- StyleXamlParser.cs
- NotSupportedException.cs
- MediaEntryAttribute.cs
- Canonicalizers.cs
- XPathNavigatorKeyComparer.cs
- PropertyFilterAttribute.cs
- FormsAuthentication.cs
- CompositionDesigner.cs
- BitArray.cs