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
- SchemaElement.cs
- ConstantProjectedSlot.cs
- Attributes.cs
- WindowsImpersonationContext.cs
- RangeValidator.cs
- ToolStripItem.cs
- SingleAnimationUsingKeyFrames.cs
- GlyphShapingProperties.cs
- WebRequestModuleElement.cs
- Bits.cs
- SoapExtensionTypeElement.cs
- SystemIPAddressInformation.cs
- LogConverter.cs
- XmlNodeReader.cs
- CollectionChangeEventArgs.cs
- WebPartTransformerAttribute.cs
- CellParaClient.cs
- GlyphRun.cs
- ButtonColumn.cs
- TargetException.cs
- ChannelBase.cs
- DataServiceQueryProvider.cs
- CanonicalFontFamilyReference.cs
- StdValidatorsAndConverters.cs
- InvokeGenerator.cs
- SQLSingle.cs
- NumberFunctions.cs
- ResolveNameEventArgs.cs
- HierarchicalDataBoundControlAdapter.cs
- FormsAuthenticationEventArgs.cs
- FileLogRecordStream.cs
- TraceSection.cs
- SemanticResolver.cs
- SamlAuthorizationDecisionStatement.cs
- GridViewDeleteEventArgs.cs
- ContactManager.cs
- AssemblyAttributesGoHere.cs
- RootBuilder.cs
- StylusEditingBehavior.cs
- ThemeDirectoryCompiler.cs
- TableLayoutSettings.cs
- AspCompat.cs
- bidPrivateBase.cs
- AliasGenerator.cs
- Rule.cs
- ToolboxSnapDragDropEventArgs.cs
- StateMachineSubscription.cs
- XmlSchemaProviderAttribute.cs
- SuppressMessageAttribute.cs
- UserNameSecurityToken.cs
- WebPartDescription.cs
- XmlIlTypeHelper.cs
- SHA1CryptoServiceProvider.cs
- ProfessionalColorTable.cs
- HTTP_SERVICE_CONFIG_URLACL_PARAM.cs
- BaseDataBoundControl.cs
- srgsitem.cs
- EntityParameter.cs
- HyperLinkColumn.cs
- RelationshipType.cs
- initElementDictionary.cs
- GenerateTemporaryTargetAssembly.cs
- SchemaInfo.cs
- ConfigXmlText.cs
- InputBuffer.cs
- WpfXamlMember.cs
- PersistenceProviderBehavior.cs
- WindowsScroll.cs
- FontInfo.cs
- LowerCaseStringConverter.cs
- HtmlInputCheckBox.cs
- ClockController.cs
- cookie.cs
- TreeViewAutomationPeer.cs
- PageParserFilter.cs
- CacheDict.cs
- BamlCollectionHolder.cs
- DataControlLinkButton.cs
- RankException.cs
- Panel.cs
- RouteItem.cs
- Site.cs
- PageHandlerFactory.cs
- ProtocolViolationException.cs
- TypeUtil.cs
- PersonalizableAttribute.cs
- XpsImage.cs
- WmlPanelAdapter.cs
- PasswordBox.cs
- OneOf.cs
- ValidationHelper.cs
- Exceptions.cs
- MimeBasePart.cs
- COM2EnumConverter.cs
- WebDescriptionAttribute.cs
- GeometryGroup.cs
- XmlNotation.cs
- EditorPartCollection.cs
- MorphHelper.cs
- AbandonedMutexException.cs