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
- SaveFileDialog.cs
- PKCS1MaskGenerationMethod.cs
- LinearGradientBrush.cs
- ColorDialog.cs
- XPathCompileException.cs
- NullableFloatSumAggregationOperator.cs
- ObjectIDGenerator.cs
- ToolStripMenuItem.cs
- ToolboxBitmapAttribute.cs
- DataListComponentEditor.cs
- DynamicResourceExtension.cs
- DataGridViewButtonCell.cs
- PageRequestManager.cs
- LogAppendAsyncResult.cs
- HttpListenerContext.cs
- WebBrowsableAttribute.cs
- ExecutionEngineException.cs
- CheckBoxField.cs
- StrokeNode.cs
- cookiecollection.cs
- _CookieModule.cs
- DropDownButton.cs
- mediapermission.cs
- InstanceCompleteException.cs
- ErrorHandler.cs
- Timeline.cs
- CurrentChangingEventManager.cs
- DbTransaction.cs
- HostingEnvironment.cs
- cryptoapiTransform.cs
- JsonEncodingStreamWrapper.cs
- Deflater.cs
- LayoutTable.cs
- SQLBoolean.cs
- LogEntrySerializer.cs
- IsolatedStorage.cs
- DynamicDataExtensions.cs
- TableParagraph.cs
- ContentPlaceHolder.cs
- CustomWebEventKey.cs
- MemoryMappedFile.cs
- EntityDataSourceSelectingEventArgs.cs
- XamlBrushSerializer.cs
- SqlException.cs
- EncodingInfo.cs
- NamespaceExpr.cs
- X509CertificateEndpointIdentity.cs
- HttpProfileBase.cs
- httpstaticobjectscollection.cs
- UserPreferenceChangingEventArgs.cs
- ResolveRequestResponseAsyncResult.cs
- SchemaTableColumn.cs
- Processor.cs
- RenderData.cs
- SqlNodeTypeOperators.cs
- StringAnimationUsingKeyFrames.cs
- WindowsGrip.cs
- WSDualHttpSecurityMode.cs
- StyleModeStack.cs
- DocumentEventArgs.cs
- ColorConvertedBitmapExtension.cs
- EventSourceCreationData.cs
- HttpHandlerAction.cs
- FilterQueryOptionExpression.cs
- DataBoundControlDesigner.cs
- NativeRightsManagementAPIsStructures.cs
- XmlLoader.cs
- ArraySegment.cs
- TableLayoutRowStyleCollection.cs
- LinearKeyFrames.cs
- OAVariantLib.cs
- WebFaultClientMessageInspector.cs
- WorkItem.cs
- WSHttpTransportSecurityElement.cs
- SqlCachedBuffer.cs
- DoubleCollectionValueSerializer.cs
- ScrollItemPatternIdentifiers.cs
- shaperfactoryquerycachekey.cs
- StringArrayConverter.cs
- _SafeNetHandles.cs
- LinqDataSourceStatusEventArgs.cs
- ButtonBase.cs
- PageAsyncTask.cs
- SqlCacheDependency.cs
- DispatchChannelSink.cs
- XmlAttributeCache.cs
- SafePointer.cs
- DockProviderWrapper.cs
- OutputScope.cs
- ProcessHostMapPath.cs
- IsolationInterop.cs
- SimpleParser.cs
- LoopExpression.cs
- ProfileGroupSettingsCollection.cs
- OLEDB_Enum.cs
- clipboard.cs
- ApplicationGesture.cs
- RemoteWebConfigurationHostStream.cs
- BitmapCacheBrush.cs
- XmlExpressionDumper.cs