Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Core / CSharp / System / Windows / Media / LineSegment.cs / 1305600 / 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
- XPathExpr.cs
- XamlBuildTaskServices.cs
- WebHeaderCollection.cs
- UnaryNode.cs
- PixelShader.cs
- DataGridViewImageColumn.cs
- SerializationHelper.cs
- XmlMembersMapping.cs
- OpenFileDialog.cs
- ButtonFlatAdapter.cs
- BindingCompleteEventArgs.cs
- loginstatus.cs
- AutomationPropertyInfo.cs
- DesignOnlyAttribute.cs
- XmlNodeWriter.cs
- SQLInt64Storage.cs
- DbDataAdapter.cs
- DictionaryEntry.cs
- BamlBinaryWriter.cs
- DockEditor.cs
- OdbcConnectionFactory.cs
- TextTreeUndo.cs
- CompilerGlobalScopeAttribute.cs
- HtmlMeta.cs
- BlockExpression.cs
- OleDbMetaDataFactory.cs
- RijndaelManaged.cs
- EdmType.cs
- PreloadedPackages.cs
- CssClassPropertyAttribute.cs
- TextTrailingCharacterEllipsis.cs
- ClientOperationFormatterProvider.cs
- Zone.cs
- DescendantQuery.cs
- HandleCollector.cs
- XmlSchemas.cs
- InvalidWMPVersionException.cs
- EdmFunctionAttribute.cs
- FixedSOMTableCell.cs
- PrimaryKeyTypeConverter.cs
- NotifyIcon.cs
- HandleCollector.cs
- WindowsImpersonationContext.cs
- PenThread.cs
- cryptoapiTransform.cs
- DesignerCommandAdapter.cs
- Calendar.cs
- DataGridViewCellValueEventArgs.cs
- ItemsControl.cs
- DataListItemCollection.cs
- OleDbMetaDataFactory.cs
- HebrewCalendar.cs
- ParallelForEach.cs
- TableItemPattern.cs
- DataPagerFieldCommandEventArgs.cs
- MbpInfo.cs
- CharacterMetricsDictionary.cs
- TreeViewHitTestInfo.cs
- GridViewColumn.cs
- WebBrowser.cs
- ChtmlCommandAdapter.cs
- SqlUserDefinedAggregateAttribute.cs
- VsPropertyGrid.cs
- ToolStripManager.cs
- JavaScriptSerializer.cs
- SelectingProviderEventArgs.cs
- BuildResult.cs
- formatter.cs
- PathSegment.cs
- PublisherMembershipCondition.cs
- SocketAddress.cs
- XmlNotation.cs
- TdsParameterSetter.cs
- TextWriter.cs
- PerspectiveCamera.cs
- RemoteWebConfigurationHostServer.cs
- IpcChannel.cs
- FindProgressChangedEventArgs.cs
- FlowLayoutSettings.cs
- DateBoldEvent.cs
- HttpVersion.cs
- GB18030Encoding.cs
- XsltInput.cs
- TickBar.cs
- _SslState.cs
- ServicePointManagerElement.cs
- UriTemplate.cs
- Context.cs
- HighlightVisual.cs
- IndependentlyAnimatedPropertyMetadata.cs
- ArrayTypeMismatchException.cs
- ConsoleCancelEventArgs.cs
- XDRSchema.cs
- BooleanToVisibilityConverter.cs
- Tokenizer.cs
- CommandDevice.cs
- TreeNodeConverter.cs
- PageRequestManager.cs
- HandlerBase.cs
- TableLayoutRowStyleCollection.cs