227 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			227 lines
		
	
	
		
			5.3 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using System.ComponentModel;
 | |
| using System.Drawing;
 | |
| using System.Drawing.Design;
 | |
| using DevComponents.DotNetBar.Charts.Style;
 | |
| using DevComponents.Charts.TextMarkup;
 | |
| 
 | |
| namespace DevComponents.DotNetBar.Charts
 | |
| {
 | |
|     /// <summary>
 | |
|     /// Represents the collection of ChartAnnotations.
 | |
|     /// </summary>
 | |
|     [Editor("DevComponents.ChartControl.Design.AnnotationCollectionEditor, DevComponents.ChartControl.Design, " +
 | |
|             "Version=14.1.0.37, Culture=neutral,  PublicKeyToken=90f470f34c89ccaf", typeof(UITypeEditor))]
 | |
|     public class ChartAnnotationCollection : CustomNamedCollection<Annotation>
 | |
|     {
 | |
|     }
 | |
| 
 | |
|     public class Annotation : ChartNote
 | |
|     {
 | |
|         #region Private variables
 | |
| 
 | |
|         private States _States;
 | |
| 
 | |
|         private float _ShapeRotation;
 | |
| 
 | |
|         private float _ConnectorRotation;
 | |
|         private float _ConnectorLength;
 | |
| 
 | |
|         private AnnotationVisualStyles _AnnotationVisualStyles;
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region Public properties
 | |
| 
 | |
|         #region AnnotationVisualStyles
 | |
| 
 | |
|         /// <summary>
 | |
|         /// Gets or sets the visual styles for the Annotation.
 | |
|         /// </summary>
 | |
|         [Category("Style")]
 | |
|         [Description("Indicates the visual styles for the Annotation.")]
 | |
|         [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
 | |
|         public AnnotationVisualStyles AnnotationVisualStyles
 | |
|         {
 | |
|             get
 | |
|             {
 | |
|                 if (_AnnotationVisualStyles == null)
 | |
|                 {
 | |
|                     _AnnotationVisualStyles = new AnnotationVisualStyles();
 | |
| 
 | |
|                     StyleVisualChangeHandler(null, _AnnotationVisualStyles);
 | |
|                 }
 | |
| 
 | |
|                 return (_AnnotationVisualStyles);
 | |
|             }
 | |
| 
 | |
|             set
 | |
|             {
 | |
|                 if (_AnnotationVisualStyles != value)
 | |
|                 {
 | |
|                     AnnotationVisualStyles oldValue = _AnnotationVisualStyles;
 | |
| 
 | |
|                     _AnnotationVisualStyles = value;
 | |
| 
 | |
|                     OnStyleChanged("AnnotationVisualStyles", oldValue, value);
 | |
| 
 | |
|                     if (oldValue != null)
 | |
|                         oldValue.Dispose();
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region ConnectorLength
 | |
| 
 | |
|         /// <summary>
 | |
|         /// Gets or Sets the length of the Annotation Connector.
 | |
|         /// </summary>
 | |
|         [Category("Appearance")]
 | |
|         [Description("Indicates the length of the Annotation Connector.")]
 | |
|         public float ConnectorLength
 | |
|         {
 | |
|             get { return (_ConnectorLength); }
 | |
| 
 | |
|             set
 | |
|             {
 | |
|                 if (_ConnectorLength != value)
 | |
|                 {
 | |
|                     _ConnectorLength = value;
 | |
| 
 | |
|                     OnPropertyChangedEx("ConnectorLength", VisualChangeType.Render);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region ConnectorRotation
 | |
| 
 | |
|         /// <summary>
 | |
|         /// Gets or Sets the rotation of the Annotation Connector.
 | |
|         /// </summary>
 | |
|         [Category("Appearance")]
 | |
|         [Description("Indicates the rotation of the Annotation Connector.")]
 | |
|         public float ConnectorRotation
 | |
|         {
 | |
|             get { return (_ConnectorRotation); }
 | |
| 
 | |
|             set
 | |
|             {
 | |
|                 if (_ConnectorRotation != value)
 | |
|                 {
 | |
|                     _ConnectorRotation = value;
 | |
| 
 | |
|                     OnPropertyChangedEx("ConnectorRotation", VisualChangeType.Render);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region ShapeRotation
 | |
| 
 | |
|         /// <summary>
 | |
|         /// Gets or Sets the rotation of the Annotation Shape.
 | |
|         /// </summary>
 | |
|         [Category("Appearance")]
 | |
|         [Description("Indicates the rotation of the Annotation Shape.")]
 | |
|         public float ShapeRotation
 | |
|         {
 | |
|             get { return (_ShapeRotation); }
 | |
| 
 | |
|             set
 | |
|             {
 | |
|                 if (_ShapeRotation != value)
 | |
|                 {
 | |
|                     _ShapeRotation = value;
 | |
| 
 | |
|                     OnPropertyChangedEx("ShapeRotation", VisualChangeType.Render);
 | |
|                 }
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         protected override void ArrangeOverride(ChartLayoutInfo layoutInfo)
 | |
|         {
 | |
|             throw new NotImplementedException();
 | |
|         }
 | |
| 
 | |
|         protected override void MeasureOverride(ChartLayoutInfo layoutInfo)
 | |
|         {
 | |
|             throw new NotImplementedException();
 | |
|         }
 | |
| 
 | |
|         protected override void RenderOverride(ChartRenderInfo renderInfo)
 | |
|         {
 | |
|             throw new NotImplementedException();
 | |
|         }
 | |
| 
 | |
|         #region Annotation States
 | |
| 
 | |
|         [Flags]
 | |
|         private enum States : uint
 | |
|         {
 | |
|         }
 | |
| 
 | |
|         #region TestState
 | |
| 
 | |
|         private bool TestState(States state)
 | |
|         {
 | |
|             return ((_States & state) == state);
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #region SetState
 | |
| 
 | |
|         private void SetState(States state, bool value)
 | |
|         {
 | |
|             if (value == true)
 | |
|                 _States |= state;
 | |
|             else
 | |
|                 _States &= ~state;
 | |
|         }
 | |
| 
 | |
|         #endregion
 | |
| 
 | |
|         #endregion
 | |
|     }
 | |
| 
 | |
|     #region enums
 | |
| 
 | |
|     #region AnnotationShape
 | |
| 
 | |
|     public enum AnnotationShape
 | |
|     {
 | |
|         NotSet = 0,
 | |
| 
 | |
|         Ellipse,
 | |
|         Rectangular,
 | |
|     }
 | |
| 
 | |
|     #endregion
 | |
| 
 | |
|     #region ConnectorShape
 | |
| 
 | |
|     public enum ConnectorShape
 | |
|     {
 | |
|         NotSet = 0,
 | |
| 
 | |
|         None,
 | |
| 
 | |
|         Arrow,
 | |
|         Line,
 | |
|         Tail,
 | |
|     }
 | |
| 
 | |
|     #endregion
 | |
| 
 | |
|     #endregion
 | |
| }
 |