Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- InstanceNormalEvent.cs
- Label.cs
- XmlCustomFormatter.cs
- CodeCatchClause.cs
- SessionStateItemCollection.cs
- ResourceKey.cs
- XamlBuildTaskServices.cs
- CommandConverter.cs
- TextCompositionManager.cs
- RowUpdatingEventArgs.cs
- XPathNavigatorReader.cs
- ValidationEventArgs.cs
- RegexMatch.cs
- DataColumnChangeEvent.cs
- PromptBuilder.cs
- SHA256Managed.cs
- FigureParagraph.cs
- ExpandCollapsePattern.cs
- EdmPropertyAttribute.cs
- CanonicalFontFamilyReference.cs
- PreviewPrintController.cs
- Base64Stream.cs
- ServerProtocol.cs
- XamlPoint3DCollectionSerializer.cs
- GPPOINT.cs
- TypedColumnHandler.cs
- SqlInternalConnectionSmi.cs
- Update.cs
- RTTypeWrapper.cs
- Rect.cs
- AssemblyInfo.cs
- SpellerHighlightLayer.cs
- FixedSOMTextRun.cs
- TypedReference.cs
- WebPartUserCapability.cs
- QueryStringParameter.cs
- SettingsBindableAttribute.cs
- RecognizedAudio.cs
- SafeRsaProviderHandle.cs
- ToolStripDropDownItemDesigner.cs
- BrushMappingModeValidation.cs
- TraceXPathNavigator.cs
- AssertFilter.cs
- MembershipValidatePasswordEventArgs.cs
- MaterializeFromAtom.cs
- NotifyIcon.cs
- ComponentSerializationService.cs
- EventKeyword.cs
- Assert.cs
- CmsUtils.cs
- DataGridLinkButton.cs
- AnimationLayer.cs
- SecUtil.cs
- NavigationWindow.cs
- LockRecursionException.cs
- ColumnCollection.cs
- SelfIssuedAuthRSAPKCS1SignatureFormatter.cs
- EntryPointNotFoundException.cs
- UriTemplateTrieLocation.cs
- RequestCache.cs
- HostedTcpTransportManager.cs
- XmlUtil.cs
- FileDetails.cs
- RowVisual.cs
- ConfigurationElementProperty.cs
- DataGridViewHeaderCell.cs
- TextDocumentView.cs
- MethodInfo.cs
- MimeMapping.cs
- IERequestCache.cs
- TemplatingOptionsDialog.cs
- AutomationPropertyInfo.cs
- TextEditorLists.cs
- PasswordTextNavigator.cs
- TileBrush.cs
- MessageHeaderException.cs
- HtmlControlPersistable.cs
- Activity.cs
- ObjectItemAssemblyLoader.cs
- InfoCardRSAPKCS1KeyExchangeDeformatter.cs
- XmlSerializationWriter.cs
- DragCompletedEventArgs.cs
- ExpressionEditorAttribute.cs
- QEncodedStream.cs
- HttpModulesSection.cs
- FontSizeConverter.cs
- SHA1Managed.cs
- PingOptions.cs
- BoundColumn.cs
- MetadataPropertyCollection.cs
- HttpClientCertificate.cs
- PackageDigitalSignature.cs
- WebSysDefaultValueAttribute.cs
- Walker.cs
- CustomAttributeBuilder.cs
- RowSpanVector.cs
- MemoryMappedViewAccessor.cs
- LinearGradientBrush.cs
- PropertyMappingExceptionEventArgs.cs
- DocumentSchemaValidator.cs