Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Web.DataVisualization / Common / Annotation / GroupAnnotation.cs
1 //-------------------------------------------------------------
2 // <copyright company=\92Microsoft Corporation\92>
3 //   Copyright © Microsoft Corporation. All Rights Reserved.
4 // </copyright>
5 //-------------------------------------------------------------
6 // @owner=alexgor, deliant
7 //=================================================================
8 //  File:               GroupAnnotation.cs
9 //
10 //  Namespace:  System.Web.UI.WebControls[Windows.Forms].Charting
11 //
12 //      Classes:        AnnotationGroup
13 //
14 //  Purpose:    Annotation group class.
15 //
16 //      Reviewed:       
17 //
18 //===================================================================
19
20 #region Used namespace
21 using System;
22 using System.Collections;
23 using System.Collections.Specialized;
24 using System.ComponentModel;
25 using System.ComponentModel.Design;
26 using System.Data;
27 using System.Drawing;
28 using System.Drawing.Design;
29 using System.Drawing.Text;
30 using System.Drawing.Drawing2D;
31 #if Microsoft_CONTROL
32 using System.Windows.Forms;
33 using System.Windows.Forms.DataVisualization.Charting;
34 using System.Windows.Forms.DataVisualization.Charting.Data;
35 using System.Windows.Forms.DataVisualization.Charting.ChartTypes;
36 using System.Windows.Forms.DataVisualization.Charting.Utilities;
37 using System.Windows.Forms.DataVisualization.Charting.Borders3D;
38
39 #else
40 using System.Web;
41 using System.Web.UI;
42 using System.Web.UI.DataVisualization.Charting;
43 using System.Web.UI.DataVisualization.Charting.Data;
44 using System.Web.UI.DataVisualization.Charting.Utilities;
45 #endif
46
47
48 #endregion
49
50 #if Microsoft_CONTROL
51 namespace System.Windows.Forms.DataVisualization.Charting
52
53 #else
54 namespace System.Web.UI.DataVisualization.Charting
55
56 #endif
57 {
58         /// <summary>
59         /// <b>AnnotationGroup</b> is a class that represents an annotation group.
60         /// </summary>
61         /// <remarks>
62         /// This class is a collection of annotations, and can be used 
63         /// to manipulate annotations relative to each other.
64         /// </remarks>
65         [
66                 SRDescription("DescriptionAttributeAnnotationGroup_AnnotationGroup"),
67         ]
68 #if ASPPERM_35
69         [AspNetHostingPermission(System.Security.Permissions.SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
70     [AspNetHostingPermission(System.Security.Permissions.SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
71 #endif
72     public class AnnotationGroup : Annotation
73         {
74                 #region Fields
75
76                 // Collection of annotations in the group
77                 internal        AnnotationCollection    annotations = null;
78
79                 #endregion
80
81                 #region Construction and Initialization
82
83                 /// <summary>
84                 /// Default public constructor.
85                 /// </summary>
86                 public AnnotationGroup() 
87             : base()
88                 {
89             annotations = new AnnotationCollection(this);
90                         annotations.AnnotationGroup = this;
91                 }
92
93                 #endregion
94
95         #region Miscellaneous Properties
96
97         /// <summary>
98         /// Gets or sets the name of the chart area which an annotation is clipped to.
99         /// </summary>
100         /// <value>
101         /// A string which represents the name of an existing chart area.
102         /// </value>
103         /// <remarks>
104         /// If the chart area name is specified, an annotation will only be drawn inside the 
105         /// plotting area of the chart area specified.  All parts of the annotation 
106         /// outside of the plotting area will be clipped.
107         /// <para>
108         /// To disable chart area clipping, set the property to "NotSet" or an empty string.
109         /// </para>
110         /// </remarks>
111                 [
112                 SRCategory("CategoryAttributeMisc"),
113         DefaultValue(Constants.NotSetValue),
114                 SRDescription("DescriptionAttributeAnnotationGroup_ClipToChartArea"),
115                 TypeConverter(typeof(LegendAreaNameConverter)),
116         Browsable(false),
117                 ]
118                 override public string ClipToChartArea
119                 {
120                         get
121                         {
122                                 return base.ClipToChartArea;
123                         }
124                         set
125                         {
126                                 base.ClipToChartArea = value;
127                                 foreach(Annotation annotation in this.annotations)
128                                 {
129                                         annotation.ClipToChartArea = value;
130                                 }
131                         }
132                 }
133
134                 #endregion
135
136         #region Position Properties
137
138         /// <summary>
139         /// Gets or sets a flag that specifies whether the size of an annotation is always 
140         /// defined in relative chart coordinates.
141         /// <seealso cref="Annotation.Width"/>
142         /// <seealso cref="Annotation.Height"/>
143         /// </summary>
144         /// <value>
145         /// <b>True</b> if an annotation's <see cref="Annotation.Width"/> and <see cref="Annotation.Height"/> are always 
146         /// in chart relative coordinates, <b>false</b> otherwise.
147         /// </value>
148         /// <remarks>
149         /// An annotation's width and height may be set in relative chart or axes coordinates. 
150         /// By default, relative chart coordinates are used.
151         /// <para>
152         /// To use axes coordinates for size set the <b>IsSizeAlwaysRelative</b> property to 
153         /// <b>false</b> and either anchor the annotation to a data point or set the 
154         /// <see cref="Annotation.AxisX"/> or <see cref="Annotation.AxisY"/> properties.
155         /// </para>
156         /// </remarks>
157                 [
158                 SRCategory("CategoryAttributePosition"),
159                 DefaultValue(true),
160                 SRDescription("DescriptionAttributeAnnotationGroup_SizeAlwaysRelative"),
161                 ]
162                 override public bool IsSizeAlwaysRelative
163                 {
164                         get
165                         {
166                                 return base.IsSizeAlwaysRelative;
167                         }
168                         set
169                         {
170                                 base.IsSizeAlwaysRelative = value;
171                         }
172                 }
173
174                 #endregion
175
176         #region Visual Properties
177
178 #if Microsoft_CONTROL
179         /// <summary>
180         /// Gets or sets a flag that determines if an annotation is selected.
181         /// <seealso cref="Annotation.AllowSelecting"/>
182         /// </summary>
183         /// <value>
184         /// <b>True</b> if the annotation is selected, <b>false</b> otherwise.
185         /// </value>
186 #else
187         /// <summary>
188         /// Gets or sets a flag that determines if an annotation is selected.
189         /// </summary>
190         /// <value>
191         /// <b>True</b> if the annotation is selected, <b>false</b> otherwise.
192         /// </value>
193 #endif // Microsoft_CONTROL
194                 [
195                 SRCategory("CategoryAttributeAppearance"),
196                 DefaultValue(false),
197                 Browsable(false),
198                 SRDescription("DescriptionAttributeAnnotationGroup_Selected"),
199                 ]
200                 override public bool IsSelected
201                 {
202                         get
203                         {
204                                 return base.IsSelected;
205                         }
206                         set
207                         {
208                                 base.IsSelected = value;
209
210                                 // Clear selection for all annotations in the group
211                                 foreach(Annotation annotation in this.annotations)
212                                 {
213                                         annotation.IsSelected = false;
214                                 }
215                         }
216                 }
217
218         /// <summary>
219         /// Gets or sets a flag that specifies whether an annotation is visible.
220         /// </summary>
221         /// <value>
222         /// <b>True</b> if the annotation is visible, <b>false</b> otherwise.
223         /// </value>
224                 [
225                 SRCategory("CategoryAttributeAppearance"),
226                 DefaultValue(true),
227                 SRDescription("DescriptionAttributeAnnotationGroup_Visible"),
228                 ParenthesizePropertyNameAttribute(true),
229                 ]
230                 override public bool Visible
231                 {
232                         get
233                         {
234                                 return base.Visible;
235                         }
236                         set
237                         {
238                                 base.Visible = value;
239                         }
240                 }
241
242         /// <summary>
243         /// Gets or sets an annotation's content alignment.
244         /// </summary>
245         /// <value>
246         /// A <see cref="ContentAlignment"/> value that represents the content alignment.
247         /// </value>
248         /// <remarks>
249         /// This property is used to align text for <see cref="TextAnnotation"/>, <see cref="RectangleAnnotation"/>,  
250         /// <see cref="EllipseAnnotation"/> and <see cref="CalloutAnnotation"/> objects, and to align 
251         /// a non-scaled image inside an <see cref="ImageAnnotation"/> object.
252         /// </remarks>
253                 [
254                 SRCategory("CategoryAttributeAppearance"),
255                 DefaultValue(typeof(ContentAlignment), "MiddleCenter"),
256                 SRDescription("DescriptionAttributeAlignment"),
257         Browsable(false),
258                 ]
259                 override public ContentAlignment Alignment
260                 {
261                         get
262                         {
263                                 return base.Alignment;
264                         }
265                         set
266                         {
267                                 base.Alignment = value;
268                                 foreach(Annotation annotation in this.annotations)
269                                 {
270                                         annotation.Alignment = value;
271                                 }
272                         }
273                 }
274
275         /// <summary>
276         /// Gets or sets an annotation's text style.
277         /// <seealso cref="Font"/>
278         ///     <seealso cref="ForeColor"/>
279         /// </summary>
280         /// <value>
281         /// A <see cref="TextStyle"/> value used to draw an annotation's text.
282         /// </value>
283         [Browsable(false)]
284         [EditorBrowsable(EditorBrowsableState.Never)]
285         public override TextStyle TextStyle
286         {
287             get
288             {
289                 return base.TextStyle;
290             }
291             set
292             {
293                 base.TextStyle = value;
294             }
295         }
296
297         /// <summary>
298         /// Gets or sets the text color of an annotation.
299         /// <seealso cref="Font"/>
300         /// </summary>
301         /// <value>
302         /// A <see cref="Color"/> value used for the text color of an annotation.
303         /// </value>
304                 [
305                 SRCategory("CategoryAttributeAppearance"),
306                 DefaultValue(typeof(Color), "Black"),
307         SRDescription("DescriptionAttributeForeColor"),
308         TypeConverter(typeof(ColorConverter)),
309         Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
310         Browsable(false),
311                 ]
312                 override public Color ForeColor
313                 {
314                         get
315                         {
316                                 return base.ForeColor;
317                         }
318                         set
319                         {
320                                 base.ForeColor = value;
321                                 foreach(Annotation annotation in this.annotations)
322                                 {
323                                         annotation.ForeColor = value;
324                                 }
325                         }
326                 }
327
328         /// <summary>
329         /// Gets or sets the font of an annotation's text.
330         /// <seealso cref="ForeColor"/>
331         /// </summary>
332         /// <value>
333         /// A <see cref="Font"/> object used for an annotation's text.
334         /// </value>
335                 [
336                 SRCategory("CategoryAttributeAppearance"),
337                 DefaultValue(typeof(Font), "Microsoft Sans Serif, 8pt"),
338                 SRDescription("DescriptionAttributeTextFont"),
339         Browsable(false),
340                 ]
341                 override public Font Font
342                 {
343                         get
344                         {
345                                 return base.Font;
346                         }
347                         set
348                         {
349                                 base.Font = value;
350                                 foreach(Annotation annotation in this.annotations)
351                                 {
352                                         annotation.Font = value;
353                                 }
354                         }
355                 }
356
357         /// <summary>
358         /// Gets or sets the color of an annotation line.
359         /// <seealso cref="LineWidth"/>
360         /// <seealso cref="LineDashStyle"/>
361         /// </summary>
362         /// <value>
363         /// A <see cref="Color"/> value used to draw an annotation line.
364         /// </value>
365                 [
366                 SRCategory("CategoryAttributeAppearance"),
367                 DefaultValue(typeof(Color), "Black"),
368                 SRDescription("DescriptionAttributeLineColor"),
369         TypeConverter(typeof(ColorConverter)),
370         Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
371         Browsable(false),
372                 ]
373                 override public Color LineColor
374                 {
375                         get
376                         {
377                                 return base.LineColor;
378                         }
379                         set
380                         {
381                                 base.LineColor = value;
382                                 foreach(Annotation annotation in this.annotations)
383                                 {
384                                         annotation.LineColor = value;
385                                 }
386                         }
387                 }
388
389         /// <summary>
390         /// Gets or sets the width of an annotation line.
391         /// <seealso cref="LineColor"/>
392         /// <seealso cref="LineDashStyle"/>
393         /// </summary>
394         /// <value>
395         /// An integer value defining the width of an annotation line in pixels.
396         /// </value>
397                 [
398                 SRCategory("CategoryAttributeAppearance"),
399                 DefaultValue(1),
400         SRDescription("DescriptionAttributeLineWidth"),
401         Browsable(false),
402                 ]
403                 override public int LineWidth
404                 {
405                         get
406                         {
407                                 return base.LineWidth;
408                         }
409                         set
410                         {
411                                 base.LineWidth = value;
412                                 foreach(Annotation annotation in this.annotations)
413                                 {
414                                         annotation.LineWidth = value;
415                                 }
416                         }
417                 }
418
419         /// <summary>
420         /// Gets or sets the style of an annotation line.
421         /// <seealso cref="LineWidth"/>
422         /// <seealso cref="LineColor"/>
423         /// </summary>
424         /// <value>
425         /// A <see cref="ChartDashStyle"/> value used to draw an annotation line.
426         /// </value>
427                 [
428                 SRCategory("CategoryAttributeAppearance"),
429                 DefaultValue(ChartDashStyle.Solid),
430         SRDescription("DescriptionAttributeLineDashStyle"),
431         Browsable(false),
432                 ]
433                 override public ChartDashStyle LineDashStyle
434                 {
435                         get
436                         {
437                                 return base.LineDashStyle;
438                         }
439                         set
440                         {
441                                 base.LineDashStyle = value;
442                                 foreach(Annotation annotation in this.annotations)
443                                 {
444                                         annotation.LineDashStyle = value;
445                                 }
446                         }
447                 }
448
449         /// <summary>
450         /// Gets or sets the background color of an annotation.
451         /// <seealso cref="BackSecondaryColor"/>
452         /// <seealso cref="BackHatchStyle"/>
453         /// <seealso cref="BackGradientStyle"/>
454         /// </summary>
455         /// <value>
456         /// A <see cref="Color"/> value used for the background of an annotation.
457         /// </value>
458                 [
459                 SRCategory("CategoryAttributeAppearance"),
460                 DefaultValue(typeof(Color), ""),
461         SRDescription("DescriptionAttributeBackColor"),
462                 NotifyParentPropertyAttribute(true),
463         TypeConverter(typeof(ColorConverter)),
464         Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
465         Browsable(false),
466                 ]
467                 override public Color BackColor
468                 {
469                         get
470                         {
471                                 return base.BackColor;
472                         }
473                         set
474                         {
475                                 base.BackColor = value;
476                                 foreach(Annotation annotation in this.annotations)
477                                 {
478                                         annotation.BackColor = value;
479                                 }
480                         }
481                 }
482
483         /// <summary>
484         /// Gets or sets the background hatch style of an annotation.
485         /// <seealso cref="BackSecondaryColor"/>
486         /// <seealso cref="BackColor"/>
487         /// <seealso cref="BackGradientStyle"/>
488         /// </summary>
489         /// <value>
490         /// A <see cref="ChartHatchStyle"/> value used for the background of an annotation.
491         /// </value>
492         /// <remarks>
493         /// Two colors are used to draw the hatching, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
494         /// </remarks>
495                 [
496                 SRCategory("CategoryAttributeAppearance"),
497                 DefaultValue(ChartHatchStyle.None),
498                 NotifyParentPropertyAttribute(true),
499                 SRDescription("DescriptionAttributeBackHatchStyle"),
500                 Editor(Editors.HatchStyleEditor.Editor, Editors.HatchStyleEditor.Base),
501         Browsable(false),
502                 ]
503                 override public ChartHatchStyle BackHatchStyle
504                 {
505                         get
506                         {
507                                 return base.BackHatchStyle;
508                         }
509                         set
510                         {
511                                 base.BackHatchStyle = value;
512                                 foreach(Annotation annotation in this.annotations)
513                                 {
514                                         annotation.BackHatchStyle = value;
515                                 }
516                         }
517                 }
518
519         /// <summary>
520         /// Gets or sets the background gradient style of an annotation.
521         /// <seealso cref="BackSecondaryColor"/>
522         /// <seealso cref="BackColor"/>
523         /// <seealso cref="BackHatchStyle"/>
524         /// </summary>
525         /// <value>
526         /// A <see cref="GradientStyle"/> value used for the background of an annotation.
527         /// </value>
528         /// <remarks>
529         /// Two colors are used to draw the gradient, <see cref="BackColor"/> and <see cref="BackSecondaryColor"/>.
530         /// </remarks>
531                 [
532                 SRCategory("CategoryAttributeAppearance"),
533                 DefaultValue(GradientStyle.None),
534                 NotifyParentPropertyAttribute(true),
535                 SRDescription("DescriptionAttributeBackGradientStyle"),
536                 Editor(Editors.GradientEditor.Editor, Editors.GradientEditor.Base),
537         Browsable(false),
538                 ]               
539                 override public GradientStyle BackGradientStyle
540                 {
541                         get
542                         {
543                                 return base.BackGradientStyle;
544                         }
545                         set
546                         {
547                                 base.BackGradientStyle = value;
548                                 foreach(Annotation annotation in this.annotations)
549                                 {
550                                         annotation.BackGradientStyle = value;
551                                 }
552                         }
553                 }
554
555         /// <summary>
556         /// Gets or sets the secondary background color of an annotation.
557         /// <seealso cref="BackColor"/>
558         /// <seealso cref="BackHatchStyle"/>
559         /// <seealso cref="BackGradientStyle"/>
560         /// </summary>
561         /// <value>
562         /// A <see cref="Color"/> value used for the secondary color of an annotation background with 
563         /// hatching or gradient fill.
564         /// </value>
565         /// <remarks>
566         /// This color is used with <see cref="BackColor"/> when <see cref="BackHatchStyle"/> or
567         /// <see cref="BackGradientStyle"/> are used.
568         /// </remarks>
569                 [
570                 SRCategory("CategoryAttributeAppearance"),
571                 DefaultValue(typeof(Color), ""),
572                 NotifyParentPropertyAttribute(true),
573         SRDescription("DescriptionAttributeBackSecondaryColor"),
574         TypeConverter(typeof(ColorConverter)),
575         Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
576         Browsable(false),
577                 ] 
578                 override public Color BackSecondaryColor
579                 {
580                         get
581                         {
582                                 return base.BackSecondaryColor;
583                         }
584                         set
585                         {
586                                 base.BackSecondaryColor = value;
587                                 foreach(Annotation annotation in this.annotations)
588                                 {
589                                         annotation.BackSecondaryColor = value;
590                                 }
591                         }
592                 }
593
594         /// <summary>
595         /// Gets or sets the color of an annotation's shadow.
596         /// <seealso cref="ShadowOffset"/>
597         /// </summary>
598         /// <value>
599         /// A <see cref="Color"/> value used to draw an annotation's shadow.
600         /// </value>
601                 [
602                 SRCategory("CategoryAttributeAppearance"),
603                 DefaultValue(typeof(Color), "128,0,0,0"),
604         SRDescription("DescriptionAttributeShadowColor"),
605         TypeConverter(typeof(ColorConverter)),
606         Editor(Editors.ChartColorEditor.Editor, Editors.ChartColorEditor.Base),
607         Browsable(false),
608                 ]
609                 override public Color ShadowColor
610                 {
611                         get
612                         {
613                                 return base.ShadowColor;
614                         }
615                         set
616                         {
617                                 base.ShadowColor = value;
618                                 foreach(Annotation annotation in this.annotations)
619                                 {
620                                         annotation.ShadowColor = value;
621                                 }
622                         }
623                 }
624
625         /// <summary>
626         /// Gets or sets the offset between an annotation and its shadow.
627         /// <seealso cref="ShadowColor"/>
628         /// </summary>
629         /// <value>
630         /// An integer value that represents the offset between an annotation and its shadow.
631         /// </value>
632                 [
633                 SRCategory("CategoryAttributeAppearance"),
634                 DefaultValue(0),
635         SRDescription("DescriptionAttributeShadowOffset"),
636         Browsable(false),
637                 ]
638                 override public int ShadowOffset
639                 {
640                         get
641                         {
642                                 return base.ShadowOffset;
643                         }
644                         set
645                         {
646                                 base.ShadowOffset = value;
647                                 foreach(Annotation annotation in this.annotations)
648                                 {
649                                         annotation.ShadowOffset = value;
650                                 }
651                         }
652                 }
653
654                 #endregion
655
656         #region Editing Permissions Properties
657
658 #if Microsoft_CONTROL
659
660                 /// <summary>
661                 /// Gets or sets a flag that specifies whether an annotation may be selected 
662                 /// with a mouse by the end user.
663                 /// </summary>
664                 /// <value>
665                 /// <b>True</b> if the annotation may be selected, <b>false</b> otherwise.
666                 /// </value>
667                 [
668                 SRCategory("CategoryAttributeEditing"),
669         DefaultValue(false),
670                 SRDescription("DescriptionAttributeAllowSelecting"),
671                 ]
672                 override public bool AllowSelecting
673                 {
674                         get
675                         {
676                                 return base.AllowSelecting;
677                         }
678                         set
679                         {
680                                 base.AllowSelecting = value;
681                         }
682                 }
683
684                 /// <summary>
685                 /// Gets or sets a flag that specifies whether an annotation may be moved 
686                 /// with a mouse by the end user.
687                 /// </summary>
688                 /// <value>
689                 /// <b>True</b> if the annotation may be moved, <b>false</b> otherwise.
690                 /// </value>
691                 [
692                 SRCategory("CategoryAttributeEditing"),
693                 DefaultValue(false),
694                 SRDescription("DescriptionAttributeAllowMoving"),
695                 ]
696                 override public bool AllowMoving
697                 {
698                         get
699                         {
700                                 return base.AllowMoving;
701                         }
702                         set
703                         {
704                                 base.AllowMoving = value;
705                         }
706                 }
707                 /// <summary>
708                 /// Gets or sets a flag that specifies whether an annotation anchor may be moved 
709                 /// with a mouse by the end user.
710                 /// </summary>
711                 /// <value>
712                 /// <b>True</b> if the annotation anchor may be moved, <b>false</b> otherwise.
713                 /// </value>
714                 [
715                 SRCategory("CategoryAttributeEditing"),
716         DefaultValue(false),
717                 SRDescription("DescriptionAttributeAnnotationGroup_AllowAnchorMoving"),
718                 ]
719                 override public bool AllowAnchorMoving
720                 {
721                         get
722                         {
723                                 return base.AllowAnchorMoving;
724                         }
725                         set
726                         {
727                                 base.AllowAnchorMoving = value;
728                         }
729                 }               
730
731                 /// <summary>
732                 /// Gets or sets a flag that specifies whether an annotation may be resized 
733                 /// with a mouse by the end user.
734                 /// </summary>
735                 /// <value>
736                 /// <b>True</b> if the annotation may be resized, <b>false</b> otherwise.
737                 /// </value>
738                 [
739                 SRCategory("CategoryAttributeEditing"),
740         DefaultValue(false),
741                 SRDescription("DescriptionAttributeAllowResizing"),
742                 ]
743                 override public bool AllowResizing
744                 {
745                         get
746                         {
747                                 return base.AllowResizing;
748                         }
749                         set
750                         {
751                                 base.AllowResizing = value;
752                         }
753                 }
754
755                 /// <summary>
756                 /// Gets or sets a flag that specifies whether an annotation's text may be edited 
757                 /// when the end user double clicks on the text.
758                 /// </summary>
759                 /// <value>
760                 /// <b>True</b> if the annotation text may be edited, <b>false</b> otherwise.
761                 /// </value>
762                 [
763                 SRCategory("CategoryAttributeEditing"),
764         DefaultValue(false),
765                 SRDescription("DescriptionAttributeAllowTextEditing"),
766                 ]
767                 override public bool AllowTextEditing
768                 {
769                         get
770                         {
771                                 return base.AllowTextEditing;
772                         }
773                         set
774                         {
775                                 base.AllowTextEditing = value;
776                         }
777                 }
778
779                 /// <summary>
780                 /// Gets or sets a flag that specifies whether a polygon annotation's points 
781                 /// may be moved with a mouse by the end user.
782                 /// </summary>
783                 /// <value>
784                 /// <b>True</b> if the polygon annotation's points may be moved, <b>false</b> otherwise.
785                 /// </value>
786                 [
787                 SRCategory("CategoryAttributeEditing"),
788         DefaultValue(false),
789                 SRDescription("DescriptionAttributeAnnotationGroup_AllowPathEditing"),
790                 ]
791                 override public bool AllowPathEditing
792                 {
793                         get
794                         {
795                                 return base.AllowPathEditing;
796                         }
797                         set
798                         {
799                                 base.AllowPathEditing = value;
800                         }
801                 }
802
803 #endif // Microsoft_CONTROL
804
805         #endregion
806
807         #region Other Properties
808
809         /// <summary>
810                 /// Gets the collection of annotations in the group.
811                 /// </summary>
812                 /// <value>
813                 /// An <see cref="AnnotationCollection"/> object.
814                 /// </value>
815                 /// <remarks>
816                 /// Note that the coordinates of all annotations in the group are relative to the 
817                 /// group annotation.
818                 /// </remarks>
819                 [
820                 SRCategory("CategoryAttributeAnnotations"),
821                 SRDescription("DescriptionAttributeAnnotationGroup_Annotations"),
822                 Editor(Editors.AnnotationCollectionEditor.Editor, Editors.AnnotationCollectionEditor.Base),
823 #if Microsoft_CONTROL
824                 DesignerSerializationVisibility(DesignerSerializationVisibility.Content), 
825 #else   // Microsoft_CONTROL
826                 PersistenceMode(PersistenceMode.InnerProperty),
827 #endif  // Microsoft_CONTROL
828                 ]
829                 public AnnotationCollection Annotations
830                 {
831                         get
832                         {
833                                 return annotations;
834                         }
835                 }
836
837         /// <summary>
838         /// Gets or sets an annotation's type name.
839         /// </summary>
840         /// <remarks>
841         /// This property is used to get the name of each annotation type 
842         /// (e.g. Line, Rectangle, Ellipse). 
843         /// <para>
844         /// This property is for internal use and is hidden at design and run time.
845         /// </para>
846         /// </remarks>
847                 [
848                 SRCategory("CategoryAttributeMisc"),
849                 Bindable(true),
850                 Browsable(false),
851                 EditorBrowsableAttribute(EditorBrowsableState.Never),
852                 DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
853                 SerializationVisibilityAttribute(SerializationVisibility.Hidden),
854                 SRDescription("DescriptionAttributeAnnotationType"),
855                 ]
856                 public override string AnnotationType
857                 {
858                         get
859                         {
860                                 return "Group";
861                         }
862                 }
863
864                 /// <summary>
865                 /// Gets or sets annotation selection points style.
866                 /// </summary>
867                 /// <value>
868                 /// A <see cref="SelectionPointsStyle"/> value that represents annotation
869                 /// selection style.
870                 /// </value>
871                 /// <remarks>
872         /// This property is for internal use and is hidden at design and run time.
873                 /// </remarks>
874                 [
875                 SRCategory("CategoryAttributeAppearance"),
876                 DefaultValue(SelectionPointsStyle.Rectangle),
877                 ParenthesizePropertyNameAttribute(true),
878                 Browsable(false),
879                 EditorBrowsableAttribute(EditorBrowsableState.Never),
880                 DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Hidden),
881                 SerializationVisibilityAttribute(SerializationVisibility.Hidden),
882                 SRDescription("DescriptionAttributeSelectionPointsStyle"),
883                 ]
884                 override internal SelectionPointsStyle SelectionPointsStyle
885                 {
886                         get
887                         {
888                                 return SelectionPointsStyle.Rectangle;
889                         }
890                 }
891
892                 #endregion
893
894                 #region Methods
895
896                 /// <summary>
897                 /// Paints an annotation object using the specified graphics.
898                 /// </summary>
899                 /// <param name="graphics">
900                 /// A <see cref="ChartGraphics"/> object, used to paint the annotation object.
901                 /// </param>
902                 /// <param name="chart">
903                 /// Reference to the <see cref="Chart"/> control.
904                 /// </param>
905         override internal void Paint(Chart chart, ChartGraphics graphics)
906                 {
907                         // Paint all annotations in the group
908                         foreach(Annotation annotation in this.annotations)
909                         {
910                                 annotation.Paint(chart, graphics);
911                         }
912
913                         if( (this.Common.ProcessModePaint && this.IsSelected) ||
914                                 this.Common.ProcessModeRegions )
915                         {
916                                 // Get annotation position in relative coordinates
917                                 PointF firstPoint = PointF.Empty;
918                                 PointF anchorPoint = PointF.Empty;
919                                 SizeF size = SizeF.Empty;
920                                 GetRelativePosition(out firstPoint, out size, out anchorPoint);
921                                 PointF  secondPoint = new PointF(firstPoint.X + size.Width, firstPoint.Y + size.Height);
922
923                                 // Create selection rectangle
924                                 RectangleF selectionRect = new RectangleF(firstPoint, new SizeF(secondPoint.X - firstPoint.X, secondPoint.Y - firstPoint.Y));
925
926                                 // Check rectangle orientation 
927                                 if(selectionRect.Width < 0)
928                                 {
929                                         selectionRect.X = selectionRect.Right;
930                                         selectionRect.Width = -selectionRect.Width;
931                                 }
932                                 if(selectionRect.Height < 0)
933                                 {
934                                         selectionRect.Y = selectionRect.Bottom;
935                                         selectionRect.Height = -selectionRect.Height;
936                                 }
937
938                                 // Check if text position is valid
939                                 if( selectionRect.IsEmpty ||
940                                         float.IsNaN(selectionRect.X) || 
941                                         float.IsNaN(selectionRect.Y) || 
942                                         float.IsNaN(selectionRect.Right) || 
943                                         float.IsNaN(selectionRect.Bottom) )
944                                 {
945                                         return;
946                                 }
947
948                                 if(this.Common.ProcessModeRegions)
949                                 {
950                                         // Add hot region
951                                         this.Common.HotRegionsList.AddHotRegion(
952                                                 selectionRect,
953                                                 ReplaceKeywords(this.ToolTip),
954 #if Microsoft_CONTROL
955                                                 String.Empty,
956                                                 String.Empty,
957                                                 String.Empty,
958 #else // Microsoft_CONTROL
959                         ReplaceKeywords(this.Url),
960                                                 ReplaceKeywords(this.MapAreaAttributes),
961                         ReplaceKeywords(this.PostBackValue),
962 #endif // Microsoft_CONTROL
963                                                 this,
964                                                 ChartElementType.Annotation,
965                                                 String.Empty);
966                                 }
967
968                                 // Paint selection handles
969                                 PaintSelectionHandles(graphics, selectionRect, null);
970                         }
971                 }
972
973                 #endregion      // Methods
974
975         #region IDisposable override
976         /// <summary>
977         /// Releases unmanaged and - optionally - managed resources
978         /// </summary>
979         /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
980         protected override void Dispose(bool disposing)
981         {
982             if (disposing)
983             {
984                 //Clean up managed resources
985                 if (this.annotations != null)
986                 {
987                     this.annotations.Dispose();
988                     this.annotations = null;
989                 }
990             }
991             base.Dispose(disposing);
992         }
993         #endregion
994     }
995 }