using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Chart;
using Chart.Utils;
using Chart.Indicators;
using DataPerformer;
namespace DataPerformerUI.UserControls
{
/// <summary>
/// Tab series control
/// </summary>
public partial class UserControlSeriesTab : UserControl
{
#region Fields
private Series series;
#endregion
#region Ctor
/// <summary>
/// Default constructor
/// </summary>
public UserControlSeriesTab()
{
InitializeComponent();
userControlSeries.ShowStrip(false);
SeriesPainterControlPovider sp =
new SeriesPainterControlPovider(toolStripButtonType, pic,
StaticPerformer.DefaultSeriesPaintingArray);
userControlSeries.PainterProvider = sp;
userControlSeries.Performer.SetMouseIndicator(
toolStripStatusCoord);
}
#endregion
#region Public Members
/// <summary>
/// Series
/// </summary>
public Series Series
{
get
{
return series;
}
set
{
series = value;
userControlSeries.Series = value;
userControlSeriesTable.Series = value;
SetLabel();
}
}
/// <summary>
/// Shows chart and all UI
/// </summary>
public void ShowAll()
{
userControlSeries.ShowAll();
userControlSeriesTable.Show = Array.GetShowTable();
userControlSeriesTable.ShowTable += (bool b) =>
{
Array.SetShowTable(b);
};
}
/// <summary>
/// Loads itself
/// </summary>
new public void Load()
{
userControlSeries.Post();
}
#endregion
#region Private And Internal Members
internal object[] Array
{
get
{
return userControlSeries.PainterProvider.Array;
}
set
{
checkBoxShow.Checked = value.GetShowTable();
userControlSeries.PainterProvider.Array = value;
}
}
internal void SaveComments()
{
//userControlSeries.Sa
}
private void SetLabel()
{
labelCount.Text = "";
if (userControlSeriesTable.Series != null)
{
labelCount.Text = userControlSeriesTable.Series.Count + "";
}
}
private void userControlSeriesTable_Update()
{
userControlSeries.ShowAll();
SetLabel();
}
private void checkBoxShow_CheckedChanged(object sender, EventArgs e)
{
bool ch = checkBoxShow.Checked;
object[] array = userControlSeries.Array;
if (ch != array.GetShowTable())
{
array.SetShowTable(ch);
userControlSeriesTable.Show = ch;
}
}
private void buttonUpdate_Click(object sender, EventArgs e)
{
userControlSeriesTable.UpdateTable();
}
private void openToolStripButton_Click(object sender, EventArgs e)
{
userControlSeries.Open();
}
private void saveToolStripButton_Click(object sender, EventArgs e)
{
userControlSeries.Save();
}
private void toolStripButtonRefresh_Click(object sender, EventArgs e)
{
userControlSeries.ShowAll();
}
#endregion
/*
internal void SaveComments()
{
try
{
if (parent != null)
{
ICollection[] coo = userControlSeries.Comments;
parent.Comments = new ICollection[] { coo[0], coo[1], userControlCommentsFont.Comments };
}
}
catch (Exception)
{
}
}*/
}
}