Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Core / CSharp / System / Windows / Media / QuadraticBezierSegment.cs / 1 / QuadraticBezierSegment.cs
//------------------------------------------------------------------------------ // Microsoft Avalon // Copyright (c) Microsoft Corporation, 2001 // // File: QuadraticBezierSegment.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 SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// QuadraticBezierSegment /// public sealed partial class QuadraticBezierSegment : PathSegment { #region Constructors ////// /// public QuadraticBezierSegment() { } ////// /// public QuadraticBezierSegment(Point point1, Point point2, bool isStroked) { Point1 = point1; Point2 = point2; IsStroked = isStroked; } ////// /// internal QuadraticBezierSegment(Point point1, Point point2, bool isStroked, bool isSmoothJoin) { Point1 = point1; Point2 = point2; 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 = Point2; if (matrix.IsIdentity) { figure.Segments.Add(this); } else { Point pt1 = Point1; pt1 *= matrix; Point pt2 = current; pt2 *= matrix; figure.Segments.Add(new QuadraticBezierSegment(pt1, pt2, IsStroked, IsSmoothJoin)); } } #endregion #region Resource ////// SerializeData - Serialize the contents of this Segment to the provided context. /// internal override void SerializeData(StreamGeometryContext ctx) { ctx.QuadraticBezierTo(Point1, Point2, IsStroked, IsSmoothJoin); } #endregion internal override bool IsCurved() { return true; } ////// 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) { // Helper to get the numeric list separator for a given culture. char separator = MS.Internal.TokenizerHelper.GetNumericListSeparator(provider); return String.Format(provider, "Q{1:" + format + "}{0}{2:" + format + "}", separator, Point1, Point2); } } } // 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: QuadraticBezierSegment.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 SR=MS.Internal.PresentationCore.SR; using SRID=MS.Internal.PresentationCore.SRID; namespace System.Windows.Media { ////// QuadraticBezierSegment /// public sealed partial class QuadraticBezierSegment : PathSegment { #region Constructors ////// /// public QuadraticBezierSegment() { } ////// /// public QuadraticBezierSegment(Point point1, Point point2, bool isStroked) { Point1 = point1; Point2 = point2; IsStroked = isStroked; } ////// /// internal QuadraticBezierSegment(Point point1, Point point2, bool isStroked, bool isSmoothJoin) { Point1 = point1; Point2 = point2; 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 = Point2; if (matrix.IsIdentity) { figure.Segments.Add(this); } else { Point pt1 = Point1; pt1 *= matrix; Point pt2 = current; pt2 *= matrix; figure.Segments.Add(new QuadraticBezierSegment(pt1, pt2, IsStroked, IsSmoothJoin)); } } #endregion #region Resource ////// SerializeData - Serialize the contents of this Segment to the provided context. /// internal override void SerializeData(StreamGeometryContext ctx) { ctx.QuadraticBezierTo(Point1, Point2, IsStroked, IsSmoothJoin); } #endregion internal override bool IsCurved() { return true; } ////// 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) { // Helper to get the numeric list separator for a given culture. char separator = MS.Internal.TokenizerHelper.GetNumericListSeparator(provider); return String.Format(provider, "Q{1:" + format + "}{0}{2:" + format + "}", separator, Point1, Point2); } } } // 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
- DerivedKeySecurityTokenStub.cs
- ButtonColumn.cs
- ReaderWriterLock.cs
- TdsParserSessionPool.cs
- Win32PrintDialog.cs
- GradientBrush.cs
- CodeGenerator.cs
- DataGridViewRowCancelEventArgs.cs
- EntityException.cs
- FontCollection.cs
- FontSourceCollection.cs
- ExpandableObjectConverter.cs
- ZipIOExtraFieldZip64Element.cs
- HwndHost.cs
- COM2PictureConverter.cs
- TreeViewDesigner.cs
- FreezableCollection.cs
- Label.cs
- XmlSignificantWhitespace.cs
- activationcontext.cs
- OneOfScalarConst.cs
- StyleSheetDesigner.cs
- ServiceBusyException.cs
- InputLanguageManager.cs
- PanelDesigner.cs
- NameValuePermission.cs
- WebPartMenu.cs
- Root.cs
- GridViewEditEventArgs.cs
- ValueTypeFixupInfo.cs
- AnnouncementClient.cs
- MarkupWriter.cs
- BCLDebug.cs
- DrawingCollection.cs
- ContentPathSegment.cs
- XmlIterators.cs
- AsyncOperationContext.cs
- WebConfigurationHost.cs
- MediaCommands.cs
- NavigationWindowAutomationPeer.cs
- HttpListenerException.cs
- Point4DValueSerializer.cs
- _Connection.cs
- SafeThreadHandle.cs
- ISessionStateStore.cs
- EDesignUtil.cs
- TypeElement.cs
- EntityProviderFactory.cs
- CapabilitiesRule.cs
- DBCommandBuilder.cs
- StatusBarItem.cs
- ImageButton.cs
- CanExecuteRoutedEventArgs.cs
- StyleCollectionEditor.cs
- ObjectDataSourceStatusEventArgs.cs
- PopupRoot.cs
- ScrollItemPatternIdentifiers.cs
- DataListItemCollection.cs
- PtsHelper.cs
- ConnectionManagementElement.cs
- XsdValidatingReader.cs
- NegationPusher.cs
- ErrorHandler.cs
- ScanQueryOperator.cs
- SetStoryboardSpeedRatio.cs
- UnmanagedMarshal.cs
- StylusDownEventArgs.cs
- UserMapPath.cs
- SafeNativeMethods.cs
- CanonicalFontFamilyReference.cs
- PrintDocument.cs
- ImageSourceConverter.cs
- IUnknownConstantAttribute.cs
- CriticalHandle.cs
- CheckBox.cs
- ControlPaint.cs
- MultipleViewPattern.cs
- ValueSerializerAttribute.cs
- UnsafeNativeMethods.cs
- SQLDateTimeStorage.cs
- PaperSource.cs
- DESCryptoServiceProvider.cs
- TextEndOfSegment.cs
- SimpleHandlerBuildProvider.cs
- InteropEnvironment.cs
- ElementProxy.cs
- VirtualDirectoryMappingCollection.cs
- SqlOuterApplyReducer.cs
- ComUdtElementCollection.cs
- DesignerDataParameter.cs
- DebugView.cs
- PackageProperties.cs
- FolderLevelBuildProviderAppliesToAttribute.cs
- SerializationAttributes.cs
- XmlMemberMapping.cs
- PageBuildProvider.cs
- MaterialGroup.cs
- PropertyChangedEventManager.cs
- COSERVERINFO.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs