using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using HaloObjects;

namespace HaloControls
{
    public partial class Value : UserControl
    {
        public int Index;

        public Value(string Description, object Value, int Index)
        {
            InitializeComponent();
            this.Index = Index;
            label1.Text = Description;
            textEdit1.Location = new Point((label1.Location.Y + label1.Size.Width) + 5, 5);
            label2.Text = Value.GetType().ToString().Replace("System.", "");
            label2.Location = new Point((textEdit1.Location.X + textEdit1.Size.Width) + 5, 8);
            textEdit1.Text = Value.ToString();
        }

        public void Reload(object Value)
        {
            textEdit1.Text = Value.ToString();
        }

        public object Save()
        {
            return textEdit1.Text;
        }
    }
}
