Code:
/ Dotnetfx_Vista_SP2 / Dotnetfx_Vista_SP2 / 8.0.50727.4016 / DEVDIV / depot / DevDiv / releases / Orcas / QFE / wpf / src / Framework / System / Windows / Shapes / Line.cs / 1 / Line.cs
//---------------------------------------------------------------------------- // File: Line.cs // // Description: // Implementation of Line shape element. // // History: // 05/30/02 - AdSmith - Created. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System.Windows.Shapes; using System.Diagnostics; using System.Windows.Threading; using System.Windows; using System.Windows.Media; using System.ComponentModel; using MS.Internal; using System; namespace System.Windows.Shapes { ////// The line shape element /// This element (like all shapes) belongs under a Canvas, /// and will be presented by the parent canvas. /// public sealed class Line : Shape { #region Constructors ////// Instantiates a new instance of a line. /// public Line() { } #endregion Constructors #region Dynamic Properties ////// X1 property /// public static readonly DependencyProperty X1Property = DependencyProperty.Register( "X1", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// X1 property /// [TypeConverter(typeof(LengthConverter))] public double X1 { get { return (double)GetValue(X1Property); } set { SetValue(X1Property, value); } } ////// Y1 property /// public static readonly DependencyProperty Y1Property = DependencyProperty.Register( "Y1", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// Y1 property /// [TypeConverter(typeof(LengthConverter))] public double Y1 { get { return (double)GetValue(Y1Property); } set { SetValue(Y1Property, value); } } ////// X2 property /// public static readonly DependencyProperty X2Property = DependencyProperty.Register( "X2", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// X2 property /// [TypeConverter(typeof(LengthConverter))] public double X2 { get { return (double)GetValue(X2Property); } set { SetValue(X2Property, value); } } ////// Y2 property /// public static readonly DependencyProperty Y2Property = DependencyProperty.Register( "Y2", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// Y2 property /// [TypeConverter(typeof(LengthConverter))] public double Y2 { get { return (double)GetValue(Y2Property); } set { SetValue(Y2Property, value); } } #endregion Dynamic Properties #region Protected Methods and Properties ////// Get the line that defines this shape /// protected override Geometry DefiningGeometry { get { return _lineGeometry; } } #endregion #region Internal Methods internal override void CacheDefiningGeometry() { Point point1 = new Point(X1, Y1); Point point2 = new Point(X2, Y2); // Create the Line geometry _lineGeometry = new LineGeometry(point1, point2); } #endregion Internal Methods #region Private Methods and Members private LineGeometry _lineGeometry; #endregion } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved. //---------------------------------------------------------------------------- // File: Line.cs // // Description: // Implementation of Line shape element. // // History: // 05/30/02 - AdSmith - Created. // // Copyright (C) 2003 by Microsoft Corporation. All rights reserved. // //--------------------------------------------------------------------------- using System.Windows.Shapes; using System.Diagnostics; using System.Windows.Threading; using System.Windows; using System.Windows.Media; using System.ComponentModel; using MS.Internal; using System; namespace System.Windows.Shapes { ////// The line shape element /// This element (like all shapes) belongs under a Canvas, /// and will be presented by the parent canvas. /// public sealed class Line : Shape { #region Constructors ////// Instantiates a new instance of a line. /// public Line() { } #endregion Constructors #region Dynamic Properties ////// X1 property /// public static readonly DependencyProperty X1Property = DependencyProperty.Register( "X1", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// X1 property /// [TypeConverter(typeof(LengthConverter))] public double X1 { get { return (double)GetValue(X1Property); } set { SetValue(X1Property, value); } } ////// Y1 property /// public static readonly DependencyProperty Y1Property = DependencyProperty.Register( "Y1", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// Y1 property /// [TypeConverter(typeof(LengthConverter))] public double Y1 { get { return (double)GetValue(Y1Property); } set { SetValue(Y1Property, value); } } ////// X2 property /// public static readonly DependencyProperty X2Property = DependencyProperty.Register( "X2", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// X2 property /// [TypeConverter(typeof(LengthConverter))] public double X2 { get { return (double)GetValue(X2Property); } set { SetValue(X2Property, value); } } ////// Y2 property /// public static readonly DependencyProperty Y2Property = DependencyProperty.Register( "Y2", typeof(double), typeof(Line), new FrameworkPropertyMetadata(0d, FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender), new ValidateValueCallback(Shape.IsDoubleFinite)); ////// Y2 property /// [TypeConverter(typeof(LengthConverter))] public double Y2 { get { return (double)GetValue(Y2Property); } set { SetValue(Y2Property, value); } } #endregion Dynamic Properties #region Protected Methods and Properties ////// Get the line that defines this shape /// protected override Geometry DefiningGeometry { get { return _lineGeometry; } } #endregion #region Internal Methods internal override void CacheDefiningGeometry() { Point point1 = new Point(X1, Y1); Point point2 = new Point(X2, Y2); // Create the Line geometry _lineGeometry = new LineGeometry(point1, point2); } #endregion Internal Methods #region Private Methods and Members private LineGeometry _lineGeometry; #endregion } } // 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
- HtmlInputText.cs
- Zone.cs
- GrammarBuilderWildcard.cs
- PopOutPanel.cs
- DataList.cs
- SafeNativeMethods.cs
- TreeNodeCollection.cs
- fixedPageContentExtractor.cs
- EpmHelper.cs
- GridViewPageEventArgs.cs
- ListViewGroupCollectionEditor.cs
- _TLSstream.cs
- ViewCellSlot.cs
- ResourceReader.cs
- RelationshipFixer.cs
- ProfileBuildProvider.cs
- ActivityCollectionMarkupSerializer.cs
- PrePrepareMethodAttribute.cs
- LinkLabel.cs
- JournalEntry.cs
- UrlMappingsSection.cs
- HttpConfigurationSystem.cs
- TextSelectionProcessor.cs
- VisualTreeHelper.cs
- ExpandSegmentCollection.cs
- DataGridViewAccessibleObject.cs
- StylusPoint.cs
- StructuredTypeEmitter.cs
- XmlQualifiedNameTest.cs
- BufferAllocator.cs
- RequestReplyCorrelator.cs
- SelectiveScrollingGrid.cs
- CriticalFinalizerObject.cs
- PointLight.cs
- WindowsGraphicsWrapper.cs
- SessionPageStateSection.cs
- URLMembershipCondition.cs
- LiteralSubsegment.cs
- NameValuePermission.cs
- ComplexLine.cs
- _AutoWebProxyScriptEngine.cs
- SymbolMethod.cs
- ListDataBindEventArgs.cs
- PartialTrustHelpers.cs
- SerializationFieldInfo.cs
- SafeNativeMethods.cs
- DesignUtil.cs
- BooleanToVisibilityConverter.cs
- AppSecurityManager.cs
- CLRBindingWorker.cs
- CallbackHandler.cs
- DataTable.cs
- GiveFeedbackEvent.cs
- InkSerializer.cs
- CopyAttributesAction.cs
- BindToObject.cs
- AnimationClock.cs
- smtppermission.cs
- XmlIlGenerator.cs
- FilteredXmlReader.cs
- CodeObjectCreateExpression.cs
- LookupBindingPropertiesAttribute.cs
- MSAAWinEventWrap.cs
- SoapExtensionImporter.cs
- XmlNode.cs
- CodeDomLoader.cs
- SeverityFilter.cs
- errorpatternmatcher.cs
- RowsCopiedEventArgs.cs
- DataFieldCollectionEditor.cs
- SubMenuStyleCollection.cs
- CngAlgorithmGroup.cs
- ResetableIterator.cs
- SequentialWorkflowRootDesigner.cs
- PerspectiveCamera.cs
- ResourceIDHelper.cs
- JavaScriptSerializer.cs
- Wildcard.cs
- PrimarySelectionAdorner.cs
- ReadOnlyPropertyMetadata.cs
- AuthorizationPolicyTypeElement.cs
- ExpressionPrefixAttribute.cs
- DataGridBeginningEditEventArgs.cs
- FormClosedEvent.cs
- Funcletizer.cs
- QilUnary.cs
- Quad.cs
- PauseStoryboard.cs
- SafeEventLogWriteHandle.cs
- KnownColorTable.cs
- SourceLocation.cs
- SetterBaseCollection.cs
- NumberSubstitution.cs
- LoadRetryHandler.cs
- _UriTypeConverter.cs
- MsmqTransportReceiveParameters.cs
- SoapTypeAttribute.cs
- IndependentAnimationStorage.cs
- TypeExtensionSerializer.cs
- NativeRightsManagementAPIsStructures.cs