Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / wpf / src / Framework / System / Windows / Shapes / Line.cs / 1305600 / Line.cs
//---------------------------------------------------------------------------- // File: Line.cs // // Description: // Implementation of Line shape element. // // History: // 05/30/02 - [....] - 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
- ObjectDataSourceMethodEventArgs.cs
- M3DUtil.cs
- _HeaderInfo.cs
- InitializationEventAttribute.cs
- ProfileManager.cs
- xsdvalidator.cs
- DiscoveryEndpointElement.cs
- DataControlHelper.cs
- ValidatedControlConverter.cs
- _ScatterGatherBuffers.cs
- FieldAccessException.cs
- serverconfig.cs
- ActivityDesigner.cs
- ToolStripItemClickedEventArgs.cs
- CheckableControlBaseAdapter.cs
- ProxyElement.cs
- WebPartUserCapability.cs
- WebEvents.cs
- CompilerGeneratedAttribute.cs
- FileSecurity.cs
- OneOfElement.cs
- LookupNode.cs
- EdmType.cs
- PartialArray.cs
- GrammarBuilderRuleRef.cs
- XmlSchemaGroupRef.cs
- Timer.cs
- FormsAuthenticationUser.cs
- PolygonHotSpot.cs
- StylusDevice.cs
- TextReader.cs
- _ListenerAsyncResult.cs
- ScrollEvent.cs
- WSTrustFeb2005.cs
- GridViewDeleteEventArgs.cs
- PtsCache.cs
- Binding.cs
- ControlsConfig.cs
- ContainerTracking.cs
- Attribute.cs
- LinkUtilities.cs
- ConnectionPoint.cs
- SqlDataAdapter.cs
- XPathMultyIterator.cs
- HandlerFactoryCache.cs
- TransactionProxy.cs
- RowToFieldTransformer.cs
- FixedSOMPage.cs
- ExpressionPrefixAttribute.cs
- Exception.cs
- ScriptBehaviorDescriptor.cs
- Viewport3DAutomationPeer.cs
- XslCompiledTransform.cs
- ContractMapping.cs
- ActivityTypeDesigner.xaml.cs
- RepeaterItem.cs
- ContentElement.cs
- LingerOption.cs
- KeyToListMap.cs
- CloudCollection.cs
- PerfService.cs
- CodeConditionStatement.cs
- AssemblyAttributesGoHere.cs
- PropertyFilter.cs
- GuidelineCollection.cs
- ZipIOCentralDirectoryBlock.cs
- RoleService.cs
- SafeThemeHandle.cs
- ShaderEffect.cs
- DiagnosticsConfiguration.cs
- DataGridPagerStyle.cs
- CommandBindingCollection.cs
- ProcessHostFactoryHelper.cs
- LayoutEditorPart.cs
- Grant.cs
- TableLayoutPanelBehavior.cs
- SystemResources.cs
- PolicyAssertionCollection.cs
- Material.cs
- ColumnResult.cs
- SatelliteContractVersionAttribute.cs
- CloseSequence.cs
- ServerType.cs
- StatusBarItemAutomationPeer.cs
- QilXmlReader.cs
- VarRefManager.cs
- validationstate.cs
- SafeBitVector32.cs
- WebControlAdapter.cs
- PropertyChangedEventArgs.cs
- ConfigXmlWhitespace.cs
- StagingAreaInputItem.cs
- BaseValidator.cs
- AssemblyInfo.cs
- DockingAttribute.cs
- UrlMappingsSection.cs
- PassportAuthenticationModule.cs
- TreeNodeBinding.cs
- ThumbButtonInfoCollection.cs
- FontCacheLogic.cs