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

namespace MetaEditor.Controls
{
    public partial class String : UserControl
    {
        public Type t;

        public String(string value, string name)
        {
            InitializeComponent();
            label2.Text = name;
            textBox1.Text = value;
            t = typeof(string);
        }
        public String(char value, string name)
        {
            InitializeComponent();
            label2.Text = name;
            textBox1.Text = value.ToString();
            t = typeof(char);
        }
        public String(char[] value, string name)
        {
            InitializeComponent();
            label2.Text = name;
            textBox1.Text = new string(value);
            t = typeof(char[]);
        }

        public void Reload(string value)
        {
            textBox1.Text = value;
        }

        public void Reload(char value)
        {
            textBox1.Text = value.ToString();
        }

        public void Reload(char[] value)
        {
            textBox1.Text = new string(value);
        }

        public string ReturnName()
        {
            return label2.Text.Replace(' ', '_');
        }

        public string ReturnStringValue()
        {
            return textBox1.Text;
        }

        public char ReturnCharValue()
        {
            return char.Parse(textBox1.Text);
        }

        public char[] ReturnCharArrayValue()
        {
            return textBox1.Text.ToCharArray();
        }
    }
}
