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
- ProxyHwnd.cs
- ByteStreamGeometryContext.cs
- SmtpReplyReaderFactory.cs
- BaseTemplateBuildProvider.cs
- ObjectStateEntryBaseUpdatableDataRecord.cs
- RegisteredHiddenField.cs
- PermissionSetTriple.cs
- DynamicUpdateCommand.cs
- EdmError.cs
- SqlBooleanMismatchVisitor.cs
- Tuple.cs
- Visual3DCollection.cs
- XmlSchemaType.cs
- PatternMatcher.cs
- OracleColumn.cs
- BaseDataListDesigner.cs
- Accessors.cs
- AbstractSvcMapFileLoader.cs
- SystemIPGlobalStatistics.cs
- HtmlControlPersistable.cs
- LeaseManager.cs
- HtmlDocument.cs
- OdbcInfoMessageEvent.cs
- ToolboxItemWrapper.cs
- InfoCardClaim.cs
- HtmlPhoneCallAdapter.cs
- PrimaryKeyTypeConverter.cs
- WebPartConnectVerb.cs
- AdornerHitTestResult.cs
- EntityDescriptor.cs
- SendMailErrorEventArgs.cs
- SchemaCreator.cs
- XmlUtil.cs
- SafeFileMapViewHandle.cs
- QilName.cs
- ProgressBar.cs
- TextClipboardData.cs
- SynchronizationContext.cs
- ContentPresenter.cs
- RootNamespaceAttribute.cs
- SpnegoTokenProvider.cs
- SecurityManager.cs
- ActiveXHost.cs
- XamlSerializerUtil.cs
- MultiAsyncResult.cs
- TreeViewImageKeyConverter.cs
- TiffBitmapDecoder.cs
- OrderByLifter.cs
- __FastResourceComparer.cs
- RayHitTestParameters.cs
- cookieexception.cs
- BigInt.cs
- Point4DConverter.cs
- HttpCapabilitiesEvaluator.cs
- XmlILOptimizerVisitor.cs
- SiteMapDesignerDataSourceView.cs
- PaintValueEventArgs.cs
- mediapermission.cs
- VScrollBar.cs
- Binding.cs
- CompositeCollectionView.cs
- DesignerUtils.cs
- CapiNative.cs
- CatalogPartChrome.cs
- StatusBarPanel.cs
- X509IssuerSerialKeyIdentifierClause.cs
- ProcessDesigner.cs
- ActivationArguments.cs
- SerializationAttributes.cs
- EncoderFallback.cs
- FreeFormDragDropManager.cs
- RectangleHotSpot.cs
- TdsParserStaticMethods.cs
- TraversalRequest.cs
- DataGridViewCheckBoxCell.cs
- DbDataReader.cs
- SspiWrapper.cs
- TypeToken.cs
- figurelengthconverter.cs
- BaseCodePageEncoding.cs
- NativeMethodsOther.cs
- XmlAutoDetectWriter.cs
- SynchronizationContext.cs
- LazyTextWriterCreator.cs
- KnownBoxes.cs
- ExtenderProvidedPropertyAttribute.cs
- DBSqlParserTable.cs
- arabicshape.cs
- XmlWriter.cs
- ActiveDocumentEvent.cs
- AsymmetricAlgorithm.cs
- PropertyOverridesDialog.cs
- ExpressionLink.cs
- ExpandoObject.cs
- QilDataSource.cs
- ScopelessEnumAttribute.cs
- SafeNativeMethodsCLR.cs
- AppDomainGrammarProxy.cs
- PageCache.cs
- ValidatedMobileControlConverter.cs