DotNet 4.8.1 build of DotNetBar
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.Design;
|
||||
using DevComponents.DotNetBar.Charts;
|
||||
|
||||
namespace DevComponents.Charts.Design
|
||||
{
|
||||
public class ChartTitleCollectionEditor : BaseCollectionEditor
|
||||
{
|
||||
#region Private variables
|
||||
|
||||
private ChartContainer _Container;
|
||||
|
||||
#endregion
|
||||
|
||||
public ChartTitleCollectionEditor(Type type)
|
||||
: base(type)
|
||||
{
|
||||
}
|
||||
|
||||
#region EditValue
|
||||
|
||||
public override object EditValue(
|
||||
ITypeDescriptorContext context, IServiceProvider provider, object value)
|
||||
{
|
||||
_Container = context.Instance as ChartContainer;
|
||||
|
||||
return (base.EditValue(context, provider, value));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CreateInstance
|
||||
|
||||
protected override object CreateInstance(Type itemType)
|
||||
{
|
||||
if (itemType == typeof(ChartTitle))
|
||||
{
|
||||
ChartTitle title = (ChartTitle)base.CreateInstance(itemType);
|
||||
|
||||
title.Name = _Container.Titles.GetUniqueName();
|
||||
|
||||
return (title);
|
||||
}
|
||||
|
||||
return (base.CreateInstance(itemType));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CopyButton_Click
|
||||
|
||||
protected override void CopyButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
ChartTitle title = ChartItem as ChartTitle;
|
||||
|
||||
if (title != null)
|
||||
{
|
||||
if (AddButton != null)
|
||||
{
|
||||
ChartControlDesigner ccd = GetDesigner(_Container.ChartControl);
|
||||
|
||||
ccd.InCopyItem = true;
|
||||
|
||||
try
|
||||
{
|
||||
AddButton.PerformClick();
|
||||
|
||||
ChartTitleCollection ctc = _Container.Titles;
|
||||
ChartTitle clone = ctc[ctc.Count - 1];
|
||||
|
||||
string name = clone.Name;
|
||||
title.CopyTo(clone);
|
||||
clone.Name = name;
|
||||
}
|
||||
finally
|
||||
{
|
||||
ccd.InCopyItem = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region CreateCollectionItemType
|
||||
|
||||
protected override Type CreateCollectionItemType()
|
||||
{
|
||||
return typeof(ChartTitle);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user