1825 lines
58 KiB
C#
1825 lines
58 KiB
C#
using System;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Drawing.Design;
|
|
using System.Windows.Forms;
|
|
|
|
namespace DevComponents.DotNetBar.Charts.Style
|
|
{
|
|
///<summary>
|
|
/// ChartSliceVisualStyles
|
|
///</summary>
|
|
[TypeConverter(typeof(VisualStylesConverter))]
|
|
public class ChartSliceVisualStyles : VisualStyles<ChartSliceVisualStyle>
|
|
{
|
|
#region Copy
|
|
|
|
/// <summary>
|
|
/// Returns the copy of the style.
|
|
/// </summary>
|
|
/// <returns>Copy of the style.</returns>
|
|
public ChartSliceVisualStyles Copy()
|
|
{
|
|
ChartSliceVisualStyles styles = new ChartSliceVisualStyles();
|
|
|
|
for (int i = 0; i < Styles.Length; i++)
|
|
{
|
|
ChartSliceVisualStyle vstyle = Styles[i];
|
|
|
|
if (vstyle != null)
|
|
styles.Styles[i] = vstyle.Copy();
|
|
}
|
|
|
|
return (styles);
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
/// <summary>
|
|
/// Represents the visual style of a series Slice.
|
|
/// </summary>
|
|
[TypeConverter(typeof(VisualStylesConverter))]
|
|
public class ChartSliceVisualStyle : BaseVisualStyle
|
|
{
|
|
#region Private variables
|
|
|
|
private SymbolDef _SymbolDef;
|
|
|
|
private SliceInnerLabelVisualStyle _SliceInnerLabelStyle;
|
|
private SliceOuterLabelVisualStyle _SliceOuterLabelStyle;
|
|
|
|
private PieReferenceLineVisualStyle _ExtentMaxRefLineStyle;
|
|
private PieReferenceLineVisualStyle _ExtentMinRefLineStyle;
|
|
private PieReferenceLineVisualStyle _ExtentAverageRefLineStyle;
|
|
private PieReferenceLineVisualStyle _ExtentOuterRefLineStyle;
|
|
|
|
private Background _Background;
|
|
private ChartLineVisualStyle _Border;
|
|
|
|
private Background _WhiteSpaceBackground;
|
|
private ChartLineVisualStyle _WhiteSpaceBorder;
|
|
|
|
private Image _Image;
|
|
private int _ImageIndex = -1;
|
|
private ImageList _ImageList;
|
|
|
|
private double _ImageRotation = double.NaN;
|
|
private Tbool _ImageAutoRotate = Tbool.NotSet;
|
|
|
|
private double _ImageRadiusOffset = double.NaN;
|
|
private double _ImageAngleOffset = double.NaN;
|
|
|
|
private double _ImageScale = double.NaN;
|
|
private ImageOverlay _ImageOverlay = ImageOverlay.NotSet;
|
|
|
|
private Padding _ImagePadding;
|
|
|
|
private SliceImageCropMode _ImageCropMode = SliceImageCropMode.NotSet;
|
|
private SliceImageRadiusAnchor _ImageInnerRadiusAnchor = SliceImageRadiusAnchor.NotSet;
|
|
private SliceImageRadiusAnchor _ImageOuterRadiusAnchor = SliceImageRadiusAnchor.NotSet;
|
|
|
|
private Tbool _EnableShading = Tbool.NotSet;
|
|
|
|
private ExtentFillRange _ExtentFillRange = ExtentFillRange.NotSet;
|
|
|
|
#endregion
|
|
|
|
#region Public properties
|
|
|
|
#region Background
|
|
|
|
/// <summary>
|
|
/// Gets or sets the background style for the slice.
|
|
/// </summary>
|
|
[Description("Indicates the background style for the slice")]
|
|
public Background Background
|
|
{
|
|
get
|
|
{
|
|
if (_Background == null)
|
|
{
|
|
_Background = Background.Empty;
|
|
|
|
UpdateChangeHandler(null, _Background);
|
|
}
|
|
|
|
return (_Background);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_Background != value)
|
|
{
|
|
UpdateChangeHandler(_Background, value);
|
|
|
|
_Background = value;
|
|
|
|
OnPropertyChangedEx("Background", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets whether property should be serialized.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private bool ShouldSerializeBackground()
|
|
{
|
|
return (_Background != null && _Background.IsEmpty == false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Resets property to its default value.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private void ResetBackground()
|
|
{
|
|
Background = null;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ExtentFillRange
|
|
|
|
///<summary>
|
|
/// Gets or sets the range area used to fill the slice extent
|
|
/// background.
|
|
///</summary>
|
|
[DefaultValue(ExtentFillRange.NotSet), Category("Behavior")]
|
|
[Description("Indicatesthe range area used to fill the slice extent background.")]
|
|
public ExtentFillRange ExtentFillRange
|
|
{
|
|
get { return (_ExtentFillRange); }
|
|
|
|
set
|
|
{
|
|
if (value != _ExtentFillRange)
|
|
{
|
|
_ExtentFillRange = value;
|
|
|
|
OnPropertyChangedEx("ExtentFillRange", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Border
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the slice border.
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual styles for the slice border.")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public ChartLineVisualStyle Border
|
|
{
|
|
get
|
|
{
|
|
if (_Border == null)
|
|
{
|
|
_Border = new ChartLineVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _Border);
|
|
}
|
|
|
|
return (_Border);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_Border != value)
|
|
{
|
|
ChartLineVisualStyle oldValue = _Border;
|
|
|
|
_Border = value;
|
|
|
|
OnStyleChanged("Border", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region EnableShading
|
|
|
|
///<summary>
|
|
/// Gets or sets whether shading is applie to the pie slice.
|
|
///</summary>
|
|
[DefaultValue(Tbool.NotSet), Category("Behavior")]
|
|
[Description("Indicates whether shading is applie to the pie slice.")]
|
|
public Tbool EnableShading
|
|
{
|
|
get { return (_EnableShading); }
|
|
|
|
set
|
|
{
|
|
if (value != _EnableShading)
|
|
{
|
|
_EnableShading = value;
|
|
|
|
OnPropertyChangedEx("EnableShading", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Image
|
|
|
|
/// <summary>
|
|
/// Gets or sets the slice Image.
|
|
/// </summary>
|
|
[DefaultValue(null), Category("Appearance")]
|
|
[Description("Indicates the slice image.")]
|
|
public Image Image
|
|
{
|
|
get { return (_Image); }
|
|
|
|
set
|
|
{
|
|
if (_Image != value)
|
|
{
|
|
_Image = value;
|
|
|
|
OnPropertyChangedEx("Image", VisualChangeType.Layout);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageAngleOffset
|
|
|
|
/// <summary>
|
|
/// Gets or sets the display angle offset for the slice image. By default, the image is
|
|
/// centered in the pie slice (mid sweepAngle), but can be offset either
|
|
/// toward the end angle (positive offset) or toward the start angle
|
|
/// (negative offset). The offset can either be a percentage (if value is
|
|
/// between 0 and 1) or pixel amount (if value > 1).
|
|
/// </summary>
|
|
[DefaultValue(double.NaN), Category("Display")]
|
|
[Description("Indicates the display angle offset for the slice image. By default, the image is centered in the pie slice (mid sweepAngle), but can be offset either toward the end angle (positive offset) or toward the start angle (negative offset). The offset can either be a percentage (if value is between 0 and 1) or pixel amount (if value > 1).")]
|
|
[Editor("DevComponents.Charts.Design.AngleOffsetRangeValueEditor, DevComponents.Charts.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf", typeof(UITypeEditor))]
|
|
public double ImageAngleOffset
|
|
{
|
|
get { return (_ImageAngleOffset); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageAngleOffset)
|
|
{
|
|
_ImageAngleOffset = value;
|
|
|
|
OnPropertyChangedEx("ImageAngleOffset", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageAutoRotate
|
|
|
|
/// <summary>
|
|
/// Gets or sets whether the Image (or Symbol) is auto
|
|
/// rotated to match the angle of the slice.
|
|
/// </summary>
|
|
[DefaultValue(Tbool.NotSet), Category("Display")]
|
|
[Description("Indicates whether the Image (or Symbol) is auto rotated to match the angle of the slice.")]
|
|
public Tbool ImageAutoRotate
|
|
{
|
|
get { return (_ImageAutoRotate); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageAutoRotate)
|
|
{
|
|
_ImageAutoRotate = value;
|
|
|
|
OnPropertyChangedEx("ImageAutoRotate", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageCropMode
|
|
|
|
/// <summary>
|
|
/// Gets or sets how the slice image will be displayed when
|
|
/// the image needs to be cropped due to 'angular' size constraints
|
|
/// (ie. will not fully fit within the slice angular bounds).
|
|
/// Default is ClipImage.
|
|
/// </summary>
|
|
[DefaultValue(SliceImageCropMode.NotSet), Category("Display")]
|
|
[Description("Indicates how the slice image will be displayed when the image needs to be cropped due to 'angular' size constraints (ie. will not fully fit within the slice angular bounds). Default is ClipImage.")]
|
|
public SliceImageCropMode ImageCropMode
|
|
{
|
|
get { return (_ImageCropMode); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageCropMode)
|
|
{
|
|
_ImageCropMode = value;
|
|
|
|
OnPropertyChangedEx("ImageCropMode", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageIndex
|
|
|
|
/// <summary>
|
|
/// Gets or sets the slice image index (used with the ImageList property).
|
|
/// </summary>
|
|
[DefaultValue(-1)]
|
|
[Category("Appearance"), Description("Indicates the slice image index (used with the ImageList property)")]
|
|
[Editor("DevComponents.SuperGrid.Design.ImageIndexEditor, DevComponents.SuperGrid.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf", typeof(UITypeEditor))]
|
|
[TypeConverter(typeof(ImageIndexConverter))]
|
|
public int ImageIndex
|
|
{
|
|
get { return (_ImageIndex); }
|
|
|
|
set
|
|
{
|
|
if (_ImageIndex != value)
|
|
{
|
|
_ImageIndex = value;
|
|
|
|
OnPropertyChangedEx("ImageIndex", VisualChangeType.Layout);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageInnerRadiusAnchor
|
|
|
|
/// <summary>
|
|
/// Gets or sets the inner radius anchor for the slice image (ie.
|
|
/// the inner limiting radius - used with the ImageRadiusOffset property).
|
|
/// </summary>
|
|
[DefaultValue(SliceImageRadiusAnchor.NotSet), Category("Display")]
|
|
[Description("Indicates the inner radius anchor for the slice image (ie. the inner limiting radius - used with the ImageRadiusOffset property).")]
|
|
public SliceImageRadiusAnchor ImageInnerRadiusAnchor
|
|
{
|
|
get { return (_ImageInnerRadiusAnchor); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageInnerRadiusAnchor)
|
|
{
|
|
_ImageInnerRadiusAnchor = value;
|
|
|
|
OnPropertyChangedEx("ImageInnerRadiusAnchor", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageList
|
|
|
|
/// <summary>
|
|
/// Gets or sets the slice ImageList.
|
|
/// </summary>
|
|
[Browsable(true), Category("Appearance"), DefaultValue(null)]
|
|
[Description("Indicates the slice ImageList.")]
|
|
public ImageList ImageList
|
|
{
|
|
get { return (_ImageList); }
|
|
|
|
set
|
|
{
|
|
if (_ImageList != value)
|
|
{
|
|
_ImageList = value;
|
|
|
|
OnPropertyChangedEx("ImageList", VisualChangeType.Layout);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageOuterRadiusAnchor
|
|
|
|
/// <summary>
|
|
/// Gets or sets the Outer radius anchor for the slice image (ie.
|
|
/// the Outer limiting radius - used with the ImageRadiusOffset percentage).
|
|
/// </summary>
|
|
[DefaultValue(SliceImageRadiusAnchor.NotSet), Category("Display")]
|
|
[Description("Indicates the Outer radius anchor for the slice image (ie. the Outer limiting radius - used with the ImageRadiusOffset percentage).")]
|
|
public SliceImageRadiusAnchor ImageOuterRadiusAnchor
|
|
{
|
|
get { return (_ImageOuterRadiusAnchor); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageOuterRadiusAnchor)
|
|
{
|
|
_ImageOuterRadiusAnchor = value;
|
|
|
|
OnPropertyChangedEx("ImageOuterRadiusAnchor", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageOverlay
|
|
|
|
/// <summary>
|
|
/// Gets or sets how to overlay the image with respect to the slice text.
|
|
/// </summary>
|
|
[DefaultValue(ImageOverlay.NotSet), Category("Appearance")]
|
|
[Description("Indicates how to overlay the image with respect to the slice text..")]
|
|
public ImageOverlay ImageOverlay
|
|
{
|
|
get { return (_ImageOverlay); }
|
|
|
|
set
|
|
{
|
|
if (_ImageOverlay != value)
|
|
{
|
|
_ImageOverlay = value;
|
|
|
|
OnPropertyChangedEx("ImageOverlay", VisualChangeType.Layout);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImagePadding
|
|
|
|
/// <summary>
|
|
/// Gets or sets the spacing between content and edges of the Image
|
|
/// </summary>
|
|
[Description("Indicates the spacing between content and edges of the Image")]
|
|
public Padding ImagePadding
|
|
{
|
|
get
|
|
{
|
|
if (_ImagePadding == null)
|
|
{
|
|
_ImagePadding = Padding.Empty;
|
|
|
|
UpdateChangeHandler(null, _ImagePadding);
|
|
}
|
|
|
|
return (_ImagePadding);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_ImagePadding != value)
|
|
{
|
|
UpdateChangeHandler(_ImagePadding, value);
|
|
|
|
_ImagePadding = value;
|
|
|
|
OnPropertyChangedEx("ImagePadding", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets whether property should be serialized.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private bool ShouldSerializeImagePadding()
|
|
{
|
|
return (_ImagePadding != null && _ImagePadding.IsEmpty == false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Resets property to its default value.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private void ResetImagePadding()
|
|
{
|
|
ImagePadding = null;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageRadiusOffset
|
|
|
|
/// <summary>
|
|
/// Gets or sets the display radius for the slice image. The image can be offset
|
|
/// toward the outer radius (positive offset) or toward the inner radius
|
|
/// (negative offset). The offset can either be a percentage (if value is
|
|
/// between 0 and 1) or pixel amount (if value > 1).
|
|
/// </summary>
|
|
[DefaultValue(double.NaN), Category("Display")]
|
|
[Description("Indicates the display radius for the slice image. The image can be offset toward the outer radius (positive offset) or toward the inner radius (negative offset). The offset can either be a percentage (if value is between 0 and 1) or pixel amount (if value > 1).")]
|
|
[Editor("DevComponents.Charts.Design.RadiusRangeValueEditor, DevComponents.Charts.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf", typeof(UITypeEditor))]
|
|
public double ImageRadiusOffset
|
|
{
|
|
get { return (_ImageRadiusOffset); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageRadiusOffset)
|
|
{
|
|
_ImageRadiusOffset = value;
|
|
|
|
OnPropertyChangedEx("ImageRadiusOffset", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageRotation
|
|
|
|
/// <summary>
|
|
/// Gets or sets the amount to rotate the image, specified in degrees.
|
|
/// </summary>
|
|
[Description("Indicates the amount to rotate the image, specified in degrees.")]
|
|
[DefaultValue(double.NaN)]
|
|
[Editor("DevComponents.Charts.Design.AngleRangeValueEditor, DevComponents.Charts.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf", typeof(UITypeEditor))]
|
|
public double ImageRotation
|
|
{
|
|
get { return (_ImageRotation); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageRotation)
|
|
{
|
|
_ImageRotation = value;
|
|
|
|
OnPropertyChangedEx("ImageRotation", VisualChangeType.Layout);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ImageScale
|
|
|
|
/// <summary>
|
|
/// Gets or sets the 'scale' factor for the image/symbol. This property informs the
|
|
/// chart to scale the image (or symbol) based upon the available space at its offset
|
|
/// position in the slice - the image is moved in or out of the slice, the image will
|
|
/// grow of shrink accordingly.
|
|
/// </summary>
|
|
[DefaultValue(double.NaN), Category("Display")]
|
|
[Description("Indicates the 'scale' factor for the image/symbol. This property informs the chart to scale the image (or symbol) based upon the available space at its offset position in the slice - the image is moved in or out of the slice, the image will grow of shrink accordingly.")]
|
|
[Editor("DevComponents.Charts.Design.RadiusRangeValueEditor, DevComponents.Charts.Design, Version=14.1.0.37, Culture=neutral, PublicKeyToken=90f470f34c89ccaf", typeof(UITypeEditor))]
|
|
public double ImageScale
|
|
{
|
|
get { return (_ImageScale); }
|
|
|
|
set
|
|
{
|
|
if (value != _ImageScale)
|
|
{
|
|
if (value < 0)
|
|
throw new Exception("ImageScale can not be negative.");
|
|
|
|
_ImageScale = value;
|
|
|
|
OnPropertyChangedEx("ImageScale", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ExtentAverageRefLineStyle
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the slice Extent Average
|
|
/// ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual style for the slice Extent Average ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public PieReferenceLineVisualStyle ExtentAverageRefLineStyle
|
|
{
|
|
get
|
|
{
|
|
if (_ExtentAverageRefLineStyle == null)
|
|
{
|
|
_ExtentAverageRefLineStyle = new PieReferenceLineVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _ExtentAverageRefLineStyle);
|
|
}
|
|
|
|
return (_ExtentAverageRefLineStyle);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_ExtentAverageRefLineStyle != value)
|
|
{
|
|
PieReferenceLineVisualStyle oldValue = _ExtentAverageRefLineStyle;
|
|
|
|
_ExtentAverageRefLineStyle = value;
|
|
|
|
OnStyleChanged("ExtentAverageRefLineStyle", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ExtentMaxRefLineStyle
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the slice Extent Maximum
|
|
/// ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual style for the slice Extent Maximum ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public PieReferenceLineVisualStyle ExtentMaxRefLineStyle
|
|
{
|
|
get
|
|
{
|
|
if (_ExtentMaxRefLineStyle == null)
|
|
{
|
|
_ExtentMaxRefLineStyle = new PieReferenceLineVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _ExtentMaxRefLineStyle);
|
|
}
|
|
|
|
return (_ExtentMaxRefLineStyle);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_ExtentMaxRefLineStyle != value)
|
|
{
|
|
PieReferenceLineVisualStyle oldValue = _ExtentMaxRefLineStyle;
|
|
|
|
_ExtentMaxRefLineStyle = value;
|
|
|
|
OnStyleChanged("ExtentMaxRefLineStyle", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ExtentMinRefLineStyle
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the slice Extent Minimum
|
|
/// ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual style for the slice Extent Minimum ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public PieReferenceLineVisualStyle ExtentMinRefLineStyle
|
|
{
|
|
get
|
|
{
|
|
if (_ExtentMinRefLineStyle == null)
|
|
{
|
|
_ExtentMinRefLineStyle = new PieReferenceLineVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _ExtentMinRefLineStyle);
|
|
}
|
|
|
|
return (_ExtentMinRefLineStyle);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_ExtentMinRefLineStyle != value)
|
|
{
|
|
PieReferenceLineVisualStyle oldValue = _ExtentMinRefLineStyle;
|
|
|
|
_ExtentMinRefLineStyle = value;
|
|
|
|
OnStyleChanged("ExtentMinRefLineStyle", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ExtentOuterRefLineStyle
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the slice Extent Outer
|
|
/// ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual style for the slice Extent Outer ReferenceLine style (see SliceVisualLayout.ReferenceLineDisplayMode).")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public PieReferenceLineVisualStyle ExtentOuterRefLineStyle
|
|
{
|
|
get
|
|
{
|
|
if (_ExtentOuterRefLineStyle == null)
|
|
{
|
|
_ExtentOuterRefLineStyle = new PieReferenceLineVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _ExtentOuterRefLineStyle);
|
|
}
|
|
|
|
return (_ExtentOuterRefLineStyle);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_ExtentOuterRefLineStyle != value)
|
|
{
|
|
PieReferenceLineVisualStyle oldValue = _ExtentOuterRefLineStyle;
|
|
|
|
_ExtentOuterRefLineStyle = value;
|
|
|
|
OnStyleChanged("ExtentOuterRefLineStyle", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SliceInnerLabelStyle
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the inner slice Label.
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual style for the inner slice Label.")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public SliceInnerLabelVisualStyle SliceInnerLabelStyle
|
|
{
|
|
get
|
|
{
|
|
if (_SliceInnerLabelStyle == null)
|
|
{
|
|
_SliceInnerLabelStyle = new SliceInnerLabelVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _SliceInnerLabelStyle);
|
|
}
|
|
|
|
return (_SliceInnerLabelStyle);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != _SliceInnerLabelStyle)
|
|
{
|
|
SliceInnerLabelVisualStyle oldValue = _SliceInnerLabelStyle;
|
|
|
|
_SliceInnerLabelStyle = value;
|
|
|
|
OnStyleChanged("SliceInnerLabelStyle", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SliceOuterLabelStyle
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the outer slice Label.
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual style for the outer slice Label.")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public SliceOuterLabelVisualStyle SliceOuterLabelStyle
|
|
{
|
|
get
|
|
{
|
|
if (_SliceOuterLabelStyle == null)
|
|
{
|
|
_SliceOuterLabelStyle = new SliceOuterLabelVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _SliceOuterLabelStyle);
|
|
}
|
|
|
|
return (_SliceOuterLabelStyle);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (value != _SliceOuterLabelStyle)
|
|
{
|
|
SliceOuterLabelVisualStyle oldValue = _SliceOuterLabelStyle;
|
|
|
|
_SliceOuterLabelStyle = value;
|
|
|
|
OnStyleChanged("SliceOuterLabelStyle", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SymbolDef
|
|
|
|
/// <summary>
|
|
/// Gets or sets the element Symbol Definition. Note that Symbol definition
|
|
/// takes precedence over Image definition. Also note that the supporting Image
|
|
/// properties (such as ImageCrpoMode, ImageRadiusOffset, etc) apply to a set
|
|
/// Symbol as well as to a set Image.
|
|
/// </summary>
|
|
[DefaultValue(null), Category("Appearance")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
[Description("Indicates the element Symbol Definition. Note that Symbol definition takes precedence over Image definition. Also note that the supporting Image properties (such as ImageCrpoMode, ImageRadiusOffset, etc) apply to a set Symbol as well as to a set Image")]
|
|
public SymbolDef SymbolDef
|
|
{
|
|
get
|
|
{
|
|
if (_SymbolDef == null)
|
|
{
|
|
_SymbolDef = new SymbolDef();
|
|
|
|
UpdateChangeHandler(null, _SymbolDef);
|
|
}
|
|
|
|
return (_SymbolDef);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_SymbolDef != value)
|
|
{
|
|
UpdateChangeHandler(_SymbolDef, value);
|
|
|
|
_SymbolDef = value;
|
|
|
|
OnPropertyChangedEx("SymbolDef", VisualChangeType.Layout);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets whether property should be serialized.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private bool ShouldSerializeSymbolDef()
|
|
{
|
|
return (_SymbolDef != null && _SymbolDef.IsEmpty == false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Resets property to its default value.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private void ResetSymbolDef()
|
|
{
|
|
SymbolDef = null;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region WhiteSpaceBackground
|
|
|
|
/// <summary>
|
|
/// Gets or sets the WhiteSpace Background (area beyond the slice extent area).
|
|
/// </summary>
|
|
[Description("Indicates the WhiteSpace Background (area beyond the slice extent area).")]
|
|
public Background WhiteSpaceBackground
|
|
{
|
|
get
|
|
{
|
|
if (_WhiteSpaceBackground == null)
|
|
{
|
|
_WhiteSpaceBackground = Background.Empty;
|
|
|
|
UpdateChangeHandler(null, _WhiteSpaceBackground);
|
|
}
|
|
|
|
return (_WhiteSpaceBackground);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_WhiteSpaceBackground != value)
|
|
{
|
|
UpdateChangeHandler(_WhiteSpaceBackground, value);
|
|
|
|
_WhiteSpaceBackground = value;
|
|
|
|
OnPropertyChangedEx("WhiteSpaceBackground", VisualChangeType.Render);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets whether property should be serialized.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private bool ShouldSerializeWhiteSpaceBackground()
|
|
{
|
|
return (_WhiteSpaceBackground != null &&
|
|
_WhiteSpaceBackground.IsEmpty == false);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Resets property to its default value.
|
|
/// </summary>
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
private void ResetWhiteSpaceBackground()
|
|
{
|
|
WhiteSpaceBackground = null;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region WhiteSpaceBorder
|
|
|
|
/// <summary>
|
|
/// Gets or sets the visual style for the slice WhiteSpace Border.
|
|
/// </summary>
|
|
[Category("Style")]
|
|
[Description("Indicates the visual styles for the slice WhiteSpace Border.")]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
|
|
public ChartLineVisualStyle WhiteSpaceBorder
|
|
{
|
|
get
|
|
{
|
|
if (_WhiteSpaceBorder == null)
|
|
{
|
|
_WhiteSpaceBorder = new ChartLineVisualStyle();
|
|
|
|
UpdateChangeHandler(null, _WhiteSpaceBorder);
|
|
}
|
|
|
|
return (_WhiteSpaceBorder);
|
|
}
|
|
|
|
set
|
|
{
|
|
if (_WhiteSpaceBorder != value)
|
|
{
|
|
ChartLineVisualStyle oldValue = _WhiteSpaceBorder;
|
|
|
|
_WhiteSpaceBorder = value;
|
|
|
|
OnStyleChanged("WhiteSpaceBorder", oldValue, value);
|
|
|
|
if (oldValue != null)
|
|
oldValue.Dispose();
|
|
}
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IsEmpty
|
|
|
|
/// <summary>
|
|
/// Gets whether the style is logically Empty.
|
|
/// </summary>
|
|
[Browsable(false)]
|
|
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
|
|
[Description("Gets whether the style is logically Empty.")]
|
|
public override bool IsEmpty
|
|
{
|
|
get
|
|
{
|
|
return ((_Background == null || _Background.IsEmpty == true) &&
|
|
(_Border == null || _Border.IsEmpty == true) &&
|
|
(_EnableShading == Tbool.NotSet) &&
|
|
(_ExtentAverageRefLineStyle == null || _ExtentAverageRefLineStyle.IsEmpty) &&
|
|
(_ExtentMaxRefLineStyle == null || _ExtentMaxRefLineStyle.IsEmpty) &&
|
|
(_ExtentMinRefLineStyle == null || _ExtentMinRefLineStyle.IsEmpty) &&
|
|
(_ExtentOuterRefLineStyle == null || _ExtentOuterRefLineStyle.IsEmpty) &&
|
|
(_Image == null) &&
|
|
(double.IsNaN(_ImageAngleOffset) == true) &&
|
|
(_ImageAutoRotate == Tbool.NotSet) &&
|
|
(_ImageCropMode == SliceImageCropMode.NotSet) &&
|
|
(_ImageIndex == -1) &&
|
|
(_ImageInnerRadiusAnchor == SliceImageRadiusAnchor.NotSet) &&
|
|
(_ImageList == null) &&
|
|
(_ImageOuterRadiusAnchor == SliceImageRadiusAnchor.NotSet) &&
|
|
(_ImageOverlay == ImageOverlay.NotSet) &&
|
|
(_ImagePadding == null || _ImagePadding.IsEmpty == true) &&
|
|
(double.IsNaN(_ImageRadiusOffset) == true) &&
|
|
(double.IsNaN(_ImageRotation) == true) &&
|
|
(double.IsNaN(_ImageScale) == true) &&
|
|
(_SliceInnerLabelStyle == null || _SliceInnerLabelStyle.IsEmpty) &&
|
|
(_SliceOuterLabelStyle == null || _SliceOuterLabelStyle.IsEmpty) &&
|
|
(_SymbolDef == null || _SymbolDef.IsEmpty == true) &&
|
|
(_WhiteSpaceBackground == null || _WhiteSpaceBackground.IsEmpty == true) &&
|
|
(_WhiteSpaceBorder == null || _WhiteSpaceBorder.IsEmpty == true) &&
|
|
(base.IsEmpty == true));
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region Internal properties
|
|
|
|
#region IsSymbolFigure
|
|
|
|
internal bool IsSymbolFigure
|
|
{
|
|
get { return (_SymbolDef != null && _SymbolDef.IsValidSymbol == true); }
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region IsValidFigure
|
|
|
|
internal bool IsValidFigure
|
|
{
|
|
get
|
|
{
|
|
if (IsSymbolFigure == true)
|
|
return (true);
|
|
|
|
return (GetImage() != null);
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region GetFigure
|
|
|
|
internal object GetFigure()
|
|
{
|
|
if (_SymbolDef != null && _SymbolDef.IsEmpty == false && _SymbolDef.SymbolSize > 0)
|
|
return (_SymbolDef);
|
|
|
|
return (GetImage());
|
|
}
|
|
|
|
#region GetImage
|
|
|
|
internal Image GetImage()
|
|
{
|
|
if (_Image != null)
|
|
return (_Image);
|
|
|
|
if (_ImageIndex >= 0)
|
|
{
|
|
ImageList imageList = ImageList;
|
|
|
|
if (imageList != null && _ImageIndex < imageList.Images.Count)
|
|
return (imageList.Images[_ImageIndex]);
|
|
}
|
|
|
|
return (null);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region GetSymbol
|
|
|
|
internal string GetSymbol()
|
|
{
|
|
if (_SymbolDef != null && _SymbolDef.IsEmpty == false)
|
|
return (_SymbolDef.SymbolRealized);
|
|
|
|
return (null);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region GetFigureSize
|
|
|
|
internal Size GetFigureSize(Graphics g)
|
|
{
|
|
Size size = Size.Empty;
|
|
|
|
if (IsSymbolFigure == true)
|
|
size = _SymbolDef.GetSymbolSize(g);
|
|
|
|
else
|
|
{
|
|
Image image = GetImage();
|
|
|
|
if (image != null)
|
|
size = Dpi.Size(image.Size);
|
|
}
|
|
|
|
if (size.IsEmpty == false)
|
|
{
|
|
size.Width += Dpi.Width(ImagePadding.Horizontal);
|
|
size.Height += Dpi.Height(ImagePadding.Vertical);
|
|
}
|
|
|
|
return (size);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region GetFigureSizeEx
|
|
|
|
internal Size GetFigureSizeEx(Graphics g)
|
|
{
|
|
Size size = Size.Empty;
|
|
|
|
if (IsSymbolFigure == true)
|
|
size = _SymbolDef.GetSymbolSize(g);
|
|
|
|
else
|
|
{
|
|
Image image = GetImage();
|
|
|
|
if (image != null)
|
|
size = Dpi.Size(image.Size);
|
|
}
|
|
|
|
return (size);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ApplyStyle
|
|
|
|
/// <summary>
|
|
/// Applies the style to instance of this style.
|
|
/// </summary>
|
|
/// <param name="style">Style to apply.</param>
|
|
public void ApplyStyle(ChartSliceVisualStyle style)
|
|
{
|
|
if (style != null)
|
|
{
|
|
base.ApplyStyle(style);
|
|
|
|
if (style._Background != null && style._Background.IsEmpty == false)
|
|
Background = style._Background.Copy();
|
|
|
|
if (style._Border != null && style._Border.IsEmpty == false)
|
|
Border.ApplyStyle(style._Border);
|
|
|
|
if (style._EnableShading != Tbool.NotSet)
|
|
EnableShading = style._EnableShading;
|
|
|
|
if (style._ExtentAverageRefLineStyle != null && style._ExtentAverageRefLineStyle.IsEmpty == false)
|
|
ExtentAverageRefLineStyle.ApplyStyle(style._ExtentAverageRefLineStyle);
|
|
|
|
if (style._ExtentFillRange != ExtentFillRange.NotSet)
|
|
ExtentFillRange = style._ExtentFillRange;
|
|
|
|
if (style._ExtentMaxRefLineStyle != null && style._ExtentMaxRefLineStyle.IsEmpty == false)
|
|
ExtentMaxRefLineStyle.ApplyStyle(style._ExtentMaxRefLineStyle);
|
|
|
|
if (style._ExtentMinRefLineStyle != null && style._ExtentMinRefLineStyle.IsEmpty == false)
|
|
ExtentMinRefLineStyle.ApplyStyle(style._ExtentMinRefLineStyle);
|
|
|
|
if (style._ExtentOuterRefLineStyle != null && style._ExtentOuterRefLineStyle.IsEmpty == false)
|
|
ExtentOuterRefLineStyle.ApplyStyle(style._ExtentOuterRefLineStyle);
|
|
|
|
if (style.Image != null)
|
|
Image = style.Image;
|
|
|
|
if (double.IsNaN(style.ImageAngleOffset) == false)
|
|
ImageAngleOffset = style.ImageAngleOffset;
|
|
|
|
if (style._ImageAutoRotate != Tbool.NotSet)
|
|
ImageAutoRotate = style._ImageAutoRotate;
|
|
|
|
if (style._ImageCropMode != SliceImageCropMode.NotSet)
|
|
ImageCropMode = style._ImageCropMode;
|
|
|
|
if (style._ImageIndex >= 0)
|
|
ImageIndex = style._ImageIndex;
|
|
|
|
if (style._ImageInnerRadiusAnchor != SliceImageRadiusAnchor.NotSet)
|
|
ImageInnerRadiusAnchor = style._ImageInnerRadiusAnchor;
|
|
|
|
if (style._ImageList != null)
|
|
ImageList = style._ImageList;
|
|
|
|
if (style._ImageOuterRadiusAnchor != SliceImageRadiusAnchor.NotSet)
|
|
ImageOuterRadiusAnchor = style._ImageOuterRadiusAnchor;
|
|
|
|
if (style._ImageOverlay != ImageOverlay.NotSet)
|
|
ImageOverlay = style._ImageOverlay;
|
|
|
|
if (style._ImagePadding != null && style._ImagePadding.IsEmpty == false)
|
|
ImagePadding = style._ImagePadding.Copy();
|
|
|
|
if (double.IsNaN(style.ImageRadiusOffset) == false)
|
|
ImageRadiusOffset = style._ImageRadiusOffset;
|
|
|
|
if (double.IsNaN(style.ImageRotation) == false)
|
|
ImageRotation = style.ImageRotation;
|
|
|
|
if (double.IsNaN(style._ImageScale) == false)
|
|
ImageScale = style._ImageScale;
|
|
|
|
if (style._SliceInnerLabelStyle != null && style._SliceInnerLabelStyle.IsEmpty == false)
|
|
SliceInnerLabelStyle.ApplyStyle(style._SliceInnerLabelStyle);
|
|
|
|
if (style._SliceOuterLabelStyle != null && style._SliceOuterLabelStyle.IsEmpty == false)
|
|
SliceOuterLabelStyle.ApplyStyle(style._SliceOuterLabelStyle);
|
|
|
|
if (style._SymbolDef != null && style._SymbolDef.IsEmpty == false)
|
|
SymbolDef = style._SymbolDef.Copy();
|
|
|
|
if (style._WhiteSpaceBackground != null && style._WhiteSpaceBackground.IsEmpty == false)
|
|
WhiteSpaceBackground = style._WhiteSpaceBackground.Copy();
|
|
|
|
if (style._WhiteSpaceBorder != null && style._WhiteSpaceBorder.IsEmpty == false)
|
|
WhiteSpaceBorder = style._WhiteSpaceBorder.Copy();
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ApplyDefaults
|
|
|
|
public override void ApplyDefaults()
|
|
{
|
|
if (_Border != null)
|
|
Border.ApplyDefaults();
|
|
|
|
ExtentAverageRefLineStyle.ApplyDefaults();
|
|
ExtentMaxRefLineStyle.ApplyDefaults();
|
|
ExtentMinRefLineStyle.ApplyDefaults();
|
|
ExtentOuterRefLineStyle.ApplyDefaults();
|
|
|
|
if (_EnableShading == Tbool.NotSet)
|
|
EnableShading = Tbool.False;
|
|
|
|
if (double.IsNaN(_ImageAngleOffset) == true)
|
|
ImageAngleOffset = 0;
|
|
|
|
if (_ImageAutoRotate == Tbool.NotSet)
|
|
ImageAutoRotate = Tbool.False;
|
|
|
|
if (ImageCropMode == SliceImageCropMode.NotSet)
|
|
ImageCropMode = SliceImageCropMode.ClipImage;
|
|
|
|
if (ImageInnerRadiusAnchor == SliceImageRadiusAnchor.NotSet)
|
|
ImageInnerRadiusAnchor = SliceImageRadiusAnchor.InnerRadius;
|
|
|
|
if (ImageOuterRadiusAnchor == SliceImageRadiusAnchor.NotSet)
|
|
ImageOuterRadiusAnchor = SliceImageRadiusAnchor.ExtentRadius;
|
|
|
|
if (ImageOverlay == Style.ImageOverlay.NotSet)
|
|
ImageOverlay = Style.ImageOverlay.Top;
|
|
|
|
if (double.IsNaN(ImageRadiusOffset) == true)
|
|
ImageRadiusOffset = .3;
|
|
|
|
if (double.IsNaN(_ImageRotation) == true)
|
|
ImageRotation = 0;
|
|
|
|
SliceInnerLabelStyle.ApplyDefaults();
|
|
SliceOuterLabelStyle.ApplyDefaults();
|
|
|
|
if (_SymbolDef != null && _SymbolDef.IsValidSymbol == true)
|
|
{
|
|
if (_SymbolDef.SymbolSize == 0)
|
|
{
|
|
if (_SliceInnerLabelStyle != null)
|
|
{
|
|
if (_SliceInnerLabelStyle.Font != null)
|
|
_SymbolDef.SymbolSize = _SliceInnerLabelStyle.Font.SizeInPoints;
|
|
}
|
|
}
|
|
|
|
if (_SymbolDef.SymbolColor.IsEmpty == true)
|
|
{
|
|
if (_SliceInnerLabelStyle != null && _SliceInnerLabelStyle.TextColor.IsEmpty == false)
|
|
_SymbolDef.SymbolColor = _SliceInnerLabelStyle.TextColor;
|
|
else
|
|
_SymbolDef.SymbolColor = Color.Black;
|
|
}
|
|
}
|
|
|
|
base.ApplyDefaults();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region Copy
|
|
|
|
/// <summary>
|
|
/// Returns the copy of the style.
|
|
/// </summary>
|
|
/// <returns>Copy of the style.</returns>
|
|
public new ChartSliceVisualStyle Copy()
|
|
{
|
|
ChartSliceVisualStyle style = new ChartSliceVisualStyle();
|
|
|
|
CopyTo(style);
|
|
|
|
return (style);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region CopyTo
|
|
|
|
/// <summary>
|
|
/// Returns the copy of the style.
|
|
/// </summary>
|
|
/// <returns>Copy of the style.</returns>
|
|
public void CopyTo(ChartSliceVisualStyle style)
|
|
{
|
|
base.CopyTo(style);
|
|
|
|
style.Background = (_Background != null) ? _Background.Copy() : null;
|
|
style.Border = (_Border != null) ? _Border.Copy() : null;
|
|
|
|
style.EnableShading = EnableShading;
|
|
style.ExtentFillRange = _ExtentFillRange;
|
|
|
|
style.ExtentAverageRefLineStyle = (_ExtentMinRefLineStyle != null) ? _ExtentMinRefLineStyle.Copy() : null;
|
|
style.ExtentMinRefLineStyle = (_ExtentMinRefLineStyle != null) ? _ExtentMinRefLineStyle.Copy() : null;
|
|
style.ExtentMaxRefLineStyle = (_ExtentMaxRefLineStyle != null) ? _ExtentMaxRefLineStyle.Copy() : null;
|
|
style.ExtentOuterRefLineStyle = (_ExtentOuterRefLineStyle != null) ? _ExtentOuterRefLineStyle.Copy() : null;
|
|
|
|
style.Image = _Image;
|
|
style.ImageAngleOffset = _ImageAngleOffset;
|
|
style.ImageAutoRotate = _ImageAutoRotate;
|
|
style.ImageCropMode =_ImageCropMode;
|
|
style.ImageIndex = _ImageIndex;
|
|
style.ImageInnerRadiusAnchor = _ImageInnerRadiusAnchor;
|
|
style.ImageList = _ImageList;
|
|
style.ImageOuterRadiusAnchor = _ImageOuterRadiusAnchor;
|
|
style.ImageOverlay = _ImageOverlay;
|
|
style.ImagePadding = (_ImagePadding != null) ? _ImagePadding.Copy() : null;
|
|
style.ImageRadiusOffset = _ImageRadiusOffset;
|
|
style.ImageRotation = _ImageRotation;
|
|
style.ImageScale = _ImageScale;
|
|
|
|
style.SliceInnerLabelStyle = (_SliceInnerLabelStyle != null) ? SliceInnerLabelStyle.Copy() : null;
|
|
style.SliceOuterLabelStyle = (_SliceOuterLabelStyle != null) ? SliceOuterLabelStyle.Copy() : null;
|
|
|
|
style.SymbolDef = (_SymbolDef != null) ? _SymbolDef.Copy() : null;
|
|
|
|
style.WhiteSpaceBackground = (_WhiteSpaceBackground != null) ? _WhiteSpaceBackground.Copy() : null;
|
|
style.WhiteSpaceBorder = (_WhiteSpaceBorder != null) ? _WhiteSpaceBorder.Copy() : null;
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region GetSerialData
|
|
|
|
internal override SerialElementCollection GetSerialData(string serialName)
|
|
{
|
|
SerialElementCollection sec = new SerialElementCollection();
|
|
|
|
if (serialName != null)
|
|
{
|
|
if (serialName.Equals("") == true)
|
|
serialName = "ChartSliceVisualStyle";
|
|
|
|
sec.AddStartElement(serialName);
|
|
}
|
|
|
|
if (_Background != null && _Background.IsEmpty == false)
|
|
sec.AddElement(_Background.GetSerialData("Background"));
|
|
|
|
if (_Border != null && _Border.IsEmpty == false)
|
|
sec.AddElement(_Border.GetSerialData("Border"));
|
|
|
|
sec.AddValue("EnableShading", EnableShading, Tbool.NotSet);
|
|
|
|
if (_ExtentAverageRefLineStyle != null && _ExtentAverageRefLineStyle.IsEmpty == false)
|
|
sec.AddElement(_ExtentAverageRefLineStyle.GetSerialData("ExtentAverageRefLineStyle"));
|
|
|
|
sec.AddValue("ExtentFillRange", ExtentFillRange, ExtentFillRange.NotSet);
|
|
|
|
if (_ExtentMaxRefLineStyle != null && _ExtentMaxRefLineStyle.IsEmpty == false)
|
|
sec.AddElement(_ExtentMaxRefLineStyle.GetSerialData("ExtentMaxRefLineStyle"));
|
|
|
|
if (_ExtentMinRefLineStyle != null && _ExtentMinRefLineStyle.IsEmpty == false)
|
|
sec.AddElement(_ExtentMinRefLineStyle.GetSerialData("ExtentMinRefLineStyle"));
|
|
|
|
if (_ExtentOuterRefLineStyle != null && _ExtentOuterRefLineStyle.IsEmpty == false)
|
|
sec.AddElement(_ExtentOuterRefLineStyle.GetSerialData("ExtentOuterRefLineStyle"));
|
|
|
|
sec.AddValue("Image", Image);
|
|
sec.AddValue("ImageAngleOffset", ImageAngleOffset, double.NaN);
|
|
sec.AddValue("ImageAutoRotate", ImageAutoRotate, Tbool.NotSet);
|
|
sec.AddValue("ImageCropMode", ImageCropMode, SliceImageCropMode.NotSet);
|
|
sec.AddValue("ImageIndex", _ImageIndex, -1);
|
|
sec.AddValue("ImageInnerRadiusAnchor", ImageInnerRadiusAnchor, SliceImageRadiusAnchor.NotSet);
|
|
|
|
if (_ImageList != null)
|
|
sec.AddValue("ImageList", XmlSerializableImageList.ConvertToString(ImageList));
|
|
|
|
sec.AddValue("ImageOuterRadiusAnchor", ImageOuterRadiusAnchor, SliceImageRadiusAnchor.NotSet);
|
|
sec.AddValue("ImageOverlay", ImageOverlay, ImageOverlay.NotSet);
|
|
|
|
if (_ImagePadding != null && _ImagePadding.IsEmpty == false)
|
|
sec.AddElement(_ImagePadding.GetSerialData("ImagePadding"));
|
|
|
|
sec.AddValue("ImageRadiusOffset", ImageRadiusOffset, double.NaN);
|
|
sec.AddValue("ImageRotation", ImageRotation, double.NaN);
|
|
sec.AddValue("ImageScale", ImageScale, double.NaN);
|
|
|
|
if (_SliceInnerLabelStyle != null && _SliceInnerLabelStyle.IsEmpty == false)
|
|
sec.AddElement(_SliceInnerLabelStyle.GetSerialData("SliceInnerLabelStyle"));
|
|
|
|
if (_SliceOuterLabelStyle != null && _SliceOuterLabelStyle.IsEmpty == false)
|
|
sec.AddElement(_SliceOuterLabelStyle.GetSerialData("SliceOuterLabelStyle"));
|
|
|
|
if (_SymbolDef != null && _SymbolDef.IsEmpty == false)
|
|
sec.AddElement(_SymbolDef.GetSerialData("SymbolDef"));
|
|
|
|
if (_WhiteSpaceBackground != null && _WhiteSpaceBackground.IsEmpty == false)
|
|
sec.AddElement(_WhiteSpaceBackground.GetSerialData("WhiteSpaceBackground"));
|
|
|
|
if (_WhiteSpaceBorder != null && _WhiteSpaceBorder.IsEmpty == false)
|
|
sec.AddElement(_WhiteSpaceBorder.GetSerialData("WhiteSpaceBorder"));
|
|
|
|
sec.AddElement(base.GetSerialData(null));
|
|
|
|
if (serialName != null)
|
|
sec.AddEndElement(serialName);
|
|
|
|
return (sec);
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region PutSerialData
|
|
|
|
#region ProcessValue
|
|
|
|
internal override void ProcessValue(SerialElement se)
|
|
{
|
|
switch (se.Name)
|
|
{
|
|
case "Image":
|
|
Image = se.GetValueImage();
|
|
break;
|
|
|
|
case "EnableShading":
|
|
EnableShading = (Tbool)se.GetValueEnum(typeof(Tbool));
|
|
break;
|
|
|
|
case "ExtentFillRange":
|
|
ExtentFillRange = (ExtentFillRange)se.GetValueEnum(typeof(ExtentFillRange));
|
|
break;
|
|
|
|
case "ImageAngleOffset":
|
|
ImageAngleOffset = double.Parse(se.StringValue);
|
|
break;
|
|
|
|
case "ImageAutoRotate":
|
|
ImageAutoRotate = (Tbool)se.GetValueEnum(typeof(Tbool));
|
|
break;
|
|
|
|
case "ImageCropMode":
|
|
ImageCropMode = (SliceImageCropMode)se.GetValueEnum(typeof(SliceImageCropMode));
|
|
break;
|
|
|
|
case "ImageIndex":
|
|
ImageIndex = int.Parse(se.StringValue);
|
|
break;
|
|
|
|
case "ImageInnerRadiusAnchor":
|
|
ImageInnerRadiusAnchor = (SliceImageRadiusAnchor)se.GetValueEnum(typeof(SliceImageRadiusAnchor));
|
|
break;
|
|
|
|
case "ImageList":
|
|
ImageList = XmlSerializableImageList.ConvertFromString(se.StringValue);
|
|
break;
|
|
|
|
case "ImageOuterRadiusAnchor":
|
|
ImageOuterRadiusAnchor = (SliceImageRadiusAnchor)se.GetValueEnum(typeof(SliceImageRadiusAnchor));
|
|
break;
|
|
|
|
case "ImageOverlay":
|
|
ImageOverlay = (ImageOverlay)se.GetValueEnum(typeof(ImageOverlay));
|
|
break;
|
|
|
|
case "ImageRadiusOffset":
|
|
ImageRadiusOffset = double.Parse(se.StringValue);
|
|
break;
|
|
|
|
case "ImageRotation":
|
|
ImageRotation = double.Parse(se.StringValue);
|
|
break;
|
|
|
|
case "ImageScale":
|
|
ImageScale = double.Parse(se.StringValue);
|
|
break;
|
|
|
|
default:
|
|
base.ProcessValue(se);
|
|
break;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ProcessCollection
|
|
|
|
internal override void ProcessCollection(SerialElement se)
|
|
{
|
|
SerialElementCollection sec = se.Sec;
|
|
|
|
switch (se.Name)
|
|
{
|
|
case "Background":
|
|
sec.PutSerialData(Background);
|
|
break;
|
|
|
|
case "Border":
|
|
sec.PutSerialData(Border);
|
|
break;
|
|
|
|
case "ExtentAverageRefLineStyle":
|
|
sec.PutSerialData(ExtentAverageRefLineStyle);
|
|
break;
|
|
|
|
case "ExtentMaxRefLineStyle":
|
|
sec.PutSerialData(ExtentMaxRefLineStyle);
|
|
break;
|
|
|
|
case "ExtentMinRefLineStyle":
|
|
sec.PutSerialData(ExtentMinRefLineStyle);
|
|
break;
|
|
|
|
case "ExtentOuterRefLineStyle":
|
|
sec.PutSerialData(ExtentOuterRefLineStyle);
|
|
break;
|
|
|
|
case "ImagePadding":
|
|
sec.PutSerialData(ImagePadding);
|
|
break;
|
|
|
|
case "SliceInnerLabelStyle":
|
|
sec.PutSerialData(SliceInnerLabelStyle);
|
|
break;
|
|
|
|
case "SliceOuterLabelStyle":
|
|
sec.PutSerialData(SliceOuterLabelStyle);
|
|
break;
|
|
|
|
case "SymbolDef":
|
|
sec.PutSerialData(SymbolDef);
|
|
break;
|
|
|
|
case "WhiteSpaceBackground":
|
|
sec.PutSerialData(WhiteSpaceBackground);
|
|
break;
|
|
|
|
case "WhiteSpaceBorder":
|
|
sec.PutSerialData(WhiteSpaceBorder);
|
|
break;
|
|
|
|
default:
|
|
base.ProcessCollection(se);
|
|
break;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
#region IDisposable
|
|
|
|
/// <summary>
|
|
/// Dispose
|
|
/// </summary>
|
|
public override void Dispose()
|
|
{
|
|
Background = null;
|
|
Border = null;
|
|
|
|
ExtentMaxRefLineStyle = null;
|
|
ExtentMinRefLineStyle = null;
|
|
ExtentAverageRefLineStyle = null;
|
|
ExtentOuterRefLineStyle = null;
|
|
|
|
ImagePadding = null;
|
|
|
|
SliceInnerLabelStyle = null;
|
|
SliceOuterLabelStyle = null;
|
|
|
|
SymbolDef = null;
|
|
|
|
WhiteSpaceBackground = null;
|
|
WhiteSpaceBorder = null;
|
|
|
|
base.Dispose();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
|
|
#region CenterLabelVisibility
|
|
|
|
/// <summary>
|
|
/// Defines the visibility of the CenterLabel
|
|
/// </summary>
|
|
public enum CenterLabelVisibility
|
|
{
|
|
/// <summary>
|
|
/// Always shown.
|
|
/// </summary>
|
|
Always,
|
|
|
|
/// <summary>
|
|
/// Never showm.
|
|
/// </summary>
|
|
Never,
|
|
|
|
/// <summary>
|
|
/// Only shown on MouseOver.
|
|
/// </summary>
|
|
MouseOver,
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SliceLabelCropMode
|
|
|
|
/// <summary>
|
|
/// Defines the label crop/clip mode.
|
|
/// </summary>
|
|
public enum SliceLabelCropMode
|
|
{
|
|
/// <summary>
|
|
/// NotSet
|
|
/// </summary>
|
|
NotSet = -1,
|
|
|
|
/// <summary>
|
|
/// No clipping or hiding performed.
|
|
/// </summary>
|
|
NoAction,
|
|
|
|
/// <summary>
|
|
/// Labels that do not fully fit will be clipped.
|
|
/// </summary>
|
|
Clip,
|
|
|
|
/// <summary>
|
|
/// Labels that do not fully fit will be hidden.
|
|
/// </summary>
|
|
Hide,
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SliceLabelDisplayMode
|
|
|
|
/// <summary>
|
|
/// Defines the slice label display mode.
|
|
/// </summary>
|
|
public enum SliceLabelDisplayMode
|
|
{
|
|
/// <summary>
|
|
/// NotSet
|
|
/// </summary>
|
|
NotSet = -1,
|
|
|
|
/// <summary>
|
|
/// No labels displayed.
|
|
/// </summary>
|
|
None,
|
|
|
|
/// <summary>
|
|
/// Inner labels only displayed (those inside the pie slice).
|
|
/// </summary>
|
|
Inner,
|
|
|
|
/// <summary>
|
|
/// Outer labels only displayed (those outside the pie slice).
|
|
/// </summary>
|
|
Outer,
|
|
|
|
/// <summary>
|
|
/// Both inner and outer labels displayed.
|
|
/// </summary>
|
|
InnerAndOuter,
|
|
|
|
/// <summary>
|
|
/// Either the inner or the outer label will be displayed, but not
|
|
/// both (outer label will be displayed only when the inner label
|
|
/// cannot be displayed).
|
|
/// </summary>
|
|
InnerXorOuter,
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SliceLabelOrientation
|
|
|
|
/// <summary>
|
|
/// Defines the slice inner label orientation.
|
|
/// </summary>
|
|
public enum SliceLabelOrientation
|
|
{
|
|
/// <summary>
|
|
/// NotSet
|
|
/// </summary>
|
|
NotSet = -1,
|
|
|
|
/// <summary>
|
|
/// The text is perpendicular to the center line of the
|
|
/// slice, and is 'adapted' to fit the outer arc of the slice.
|
|
/// </summary>
|
|
Adaptive,
|
|
|
|
/// <summary>
|
|
/// The label layout is gotten from the set 'Custom' layout
|
|
/// properties for the slice (include location, size, orientation, etc).
|
|
/// This option give the most control over the presentation of the label.
|
|
/// </summary>
|
|
Custom,
|
|
|
|
/// <summary>
|
|
/// Labels are presented horizontally, within the bounds of the slice.
|
|
/// </summary>
|
|
Horizontal,
|
|
|
|
/// <summary>
|
|
/// Labels are presented parallel to the slice center line, within
|
|
/// the bounds of the slice.
|
|
/// </summary>
|
|
Parallel,
|
|
|
|
/// <summary>
|
|
/// Labels are presented perpendicular to the slice center line, within
|
|
/// the bounds of the slice.
|
|
/// </summary>
|
|
Perpendicular,
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region SliceLabelVisibility
|
|
|
|
/// <summary>
|
|
/// Defines the visibility of the slice labels. These values
|
|
/// can be combined to define a more targeted visibility.
|
|
/// </summary>
|
|
[Flags]
|
|
public enum SliceLabelVisibility
|
|
{
|
|
/// <summary>
|
|
/// NotSet
|
|
/// </summary>
|
|
NotSet = 0,
|
|
|
|
/// <summary>
|
|
/// Labels are always visible.
|
|
/// </summary>
|
|
Always = (1 << 0),
|
|
|
|
/// <summary>
|
|
/// Labels are never visible.
|
|
/// </summary>
|
|
Never = (1 << 1),
|
|
|
|
/// <summary>
|
|
/// Labels will be shown according to the SelectionMode
|
|
/// setting in effect (ie. Ring, Slice, Pie, etc).
|
|
/// </summary>
|
|
SelectionModeMouseOver = (1 << 2),
|
|
|
|
/// <summary>
|
|
/// Labels are shown for Detached slices.
|
|
/// </summary>
|
|
SliceDetach = (1 << 3),
|
|
|
|
/// <summary>
|
|
/// Labels are shown on MouseOver.
|
|
/// </summary>
|
|
SliceMouseOver = (1 << 4),
|
|
|
|
/// <summary>
|
|
/// Labels are shown for selected slices.
|
|
/// </summary>
|
|
SliceSelect = (1 << 5),
|
|
}
|
|
|
|
#endregion
|
|
}
|