Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / 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
- PtsCache.cs
- PolyLineSegment.cs
- NCryptSafeHandles.cs
- ExceptionValidationRule.cs
- SqlTriggerAttribute.cs
- PropertyConverter.cs
- WsdlInspector.cs
- ImageMap.cs
- PolicyManager.cs
- DetailsViewUpdateEventArgs.cs
- base64Transforms.cs
- CommandDevice.cs
- KoreanCalendar.cs
- XmlSchemaNotation.cs
- TrackingProfile.cs
- PropertyValueUIItem.cs
- WebPartTransformer.cs
- WindowsFormsHelpers.cs
- OleDbRowUpdatedEvent.cs
- Site.cs
- DataGridTable.cs
- DataServiceQuery.cs
- SweepDirectionValidation.cs
- StorageComplexPropertyMapping.cs
- CharAnimationBase.cs
- FlowDocumentView.cs
- BitmapPalettes.cs
- WindowsListViewItemCheckBox.cs
- ComponentDispatcher.cs
- Point4D.cs
- CorrelationToken.cs
- TargetParameterCountException.cs
- SafeSystemMetrics.cs
- BoundPropertyEntry.cs
- HandlerFactoryWrapper.cs
- KeyboardDevice.cs
- LabelLiteral.cs
- NegatedCellConstant.cs
- MonitorWrapper.cs
- XPathItem.cs
- _HeaderInfoTable.cs
- Tuple.cs
- SoapConverter.cs
- SqlDataSourceWizardForm.cs
- TypeBuilderInstantiation.cs
- messageonlyhwndwrapper.cs
- BitmapImage.cs
- WpfWebRequestHelper.cs
- DecoderFallback.cs
- DataGridViewElement.cs
- DrawingAttributeSerializer.cs
- TextEditorCopyPaste.cs
- FilterableData.cs
- WizardForm.cs
- DescendantQuery.cs
- ObjectResult.cs
- Command.cs
- EmulateRecognizeCompletedEventArgs.cs
- TransportChannelListener.cs
- _AutoWebProxyScriptEngine.cs
- SqlNotificationRequest.cs
- TextTreeFixupNode.cs
- CachedFontFace.cs
- entitydatasourceentitysetnameconverter.cs
- BinaryCommonClasses.cs
- Vector3D.cs
- ExpressionBuilder.cs
- AvTrace.cs
- DataObjectMethodAttribute.cs
- SqlCacheDependency.cs
- NamespaceInfo.cs
- TypeConverterValueSerializer.cs
- ToolStripDropDown.cs
- ScriptResourceMapping.cs
- TableDetailsCollection.cs
- LicenseProviderAttribute.cs
- Pkcs9Attribute.cs
- RadioButtonBaseAdapter.cs
- ToolboxItemSnapLineBehavior.cs
- StorageFunctionMapping.cs
- TextRenderer.cs
- UnsafeNativeMethods.cs
- StrongName.cs
- EnumerableCollectionView.cs
- SchemaEntity.cs
- WinInet.cs
- PerformanceCounterPermissionEntry.cs
- CellParaClient.cs
- SchemaCollectionPreprocessor.cs
- SimpleWebHandlerParser.cs
- ObservableCollection.cs
- Variable.cs
- ContextBase.cs
- ToolTipService.cs
- CombinedGeometry.cs
- RsaSecurityToken.cs
- DtcInterfaces.cs
- MeasurementDCInfo.cs
- SeekableMessageNavigator.cs
- LogSwitch.cs