using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DiagramUI.Labels;
using DiagramUI;
using Diagram.UI.Interfaces;
using DataPerformer;
namespace DataPerformerUI.Forms
{
/// <summary>
/// Editor of vector consumer
/// </summary>
public partial class FormVectorConsumer : Form, IUpdatableForm
{
#region Fields
private VectorFormulaConsumer consumer;
private IObjectLabel label;
#endregion
#region Ctor
private FormVectorConsumer()
{
InitializeComponent();
}
/// <summary>
/// Constructor
/// </summary>
/// <param name="label">Label</param>
public FormVectorConsumer(IObjectLabel label)
: this()
{
this.LoadResources();
this.label = label;
this.consumer = label.Object as VectorFormulaConsumer;
UpdateFormUI();
}
#endregion
#region IUpdatableForm Members
/// <summary>
/// Updates form UI
/// </summary>
public void UpdateFormUI()
{
Text = label.Name;
}
#endregion
private void FormVectorConsumer_Load(object sender, EventArgs e)
{
userControlFormulaEditor.Consumer = consumer;
userControlFormulaEditor.Load();
}
private void FormVectorConsumer_FormClosing(object sender, FormClosingEventArgs e)
{
userControlFormulaEditor.SaveComments();
}
}
}