using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DiagramUI.Labels;
using Diagram.UI.Interfaces;
namespace DataPerformerUI.Forms
{
/// <summary>
/// Editor of properties of series
/// </summary>
public partial class FormSeries : Form, IUpdatableForm
{
#region Fields
IObjectLabel l;
#endregion
#region Ctor
private FormSeries()
{
InitializeComponent();
this.LoadResources();
}
/// <summary>
/// Consrutor
/// </summary>
/// <param name="l">Object label</param>
/// <param name="array">Drawing array</param>
public FormSeries(IObjectLabel l, object[] array)
: this()
{
this.l = l;
UpdateFormUI();
DataPerformer.Series s = l.Object as DataPerformer.Series;
userControlSeriesTab.Series = s;
userControlSeriesTab.Array = array;
}
#endregion
#region IUpdatableForm Members
/// <summary>
/// Updates form UI
/// </summary>
public void UpdateFormUI()
{
Text = l.Name;
}
#endregion
private void FormSeries_Load(object sender, EventArgs e)
{
userControlSeriesTab.ShowAll();
userControlSeriesTab.SetFormula += (string formula) =>
{
if (l is DataPerformerUI.Labels.SeriesLabel)
{
(l as DataPerformerUI.Labels.SeriesLabel).Formula = formula;
}
};
if (l is DataPerformerUI.Labels.SeriesLabel)
{
userControlSeriesTab.Formula = (l as DataPerformerUI.Labels.SeriesLabel).Formula;
}
}
}
}