Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / Orcas / SP / 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
- XmlLoader.cs
- AttachedPropertyBrowsableForChildrenAttribute.cs
- DataColumnChangeEvent.cs
- GPPOINT.cs
- InputScopeManager.cs
- TextTreeObjectNode.cs
- InternalPermissions.cs
- __FastResourceComparer.cs
- FixedMaxHeap.cs
- ClientUtils.cs
- ColorInterpolationModeValidation.cs
- LineProperties.cs
- HuffmanTree.cs
- ClipboardData.cs
- FlowDocumentFormatter.cs
- CapiNative.cs
- InputLangChangeEvent.cs
- DataPagerFieldCommandEventArgs.cs
- ComponentCache.cs
- CellRelation.cs
- base64Transforms.cs
- LinkDescriptor.cs
- ImportContext.cs
- DataGridComponentEditor.cs
- Qualifier.cs
- ToolstripProfessionalRenderer.cs
- Wildcard.cs
- WorkItem.cs
- NamespaceDecl.cs
- InteropAutomationProvider.cs
- OdbcHandle.cs
- ToolboxItemFilterAttribute.cs
- DecoderFallbackWithFailureFlag.cs
- Point3DValueSerializer.cs
- EntityDataSourceDataSelectionPanel.cs
- COM2IDispatchConverter.cs
- ScrollChrome.cs
- DeclaredTypeElement.cs
- PointLightBase.cs
- ScriptControlManager.cs
- ToolZone.cs
- Rules.cs
- HttpHandlersSection.cs
- xmlfixedPageInfo.cs
- ColumnHeaderConverter.cs
- ImmutablePropertyDescriptorGridEntry.cs
- columnmapfactory.cs
- SqlGatherConsumedAliases.cs
- ProcessModelSection.cs
- RectAnimation.cs
- SlipBehavior.cs
- ErrorHandlerModule.cs
- LogRecordSequence.cs
- CodeDelegateCreateExpression.cs
- MissingMemberException.cs
- Graphics.cs
- TypeResolver.cs
- BaseParagraph.cs
- TreeView.cs
- RemotingAttributes.cs
- DataGridViewRowConverter.cs
- DocumentReference.cs
- TrailingSpaceComparer.cs
- SelectionPattern.cs
- VisemeEventArgs.cs
- MatrixStack.cs
- ProfileGroupSettingsCollection.cs
- CommonDialog.cs
- CultureMapper.cs
- SafeEventLogReadHandle.cs
- SecurityContext.cs
- InternalCompensate.cs
- DrawingVisualDrawingContext.cs
- RC2CryptoServiceProvider.cs
- BlurBitmapEffect.cs
- BasicAsyncResult.cs
- ListMarkerLine.cs
- dtdvalidator.cs
- SystemIPInterfaceStatistics.cs
- TableCell.cs
- TableChangeProcessor.cs
- StorageInfo.cs
- XamlParser.cs
- PositiveTimeSpanValidatorAttribute.cs
- RawStylusInputCustomDataList.cs
- DataGridViewCellMouseEventArgs.cs
- Publisher.cs
- StatusBar.cs
- ContainerCodeDomSerializer.cs
- SQLString.cs
- GenericWebPart.cs
- Int64KeyFrameCollection.cs
- CodeMethodReturnStatement.cs
- ChtmlTextWriter.cs
- SqlFileStream.cs
- SubMenuStyleCollectionEditor.cs
- IsolatedStorageFilePermission.cs
- DivideByZeroException.cs
- InfoCardRSAPKCS1SignatureFormatter.cs
- RijndaelManaged.cs