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
{
    /// <summary>
    /// Used to Display Unknown Data
    /// </summary>
    public partial class Unknown : UserControl
    {
        /// <summary>
        /// Constructs a new instance of the control
        /// </summary>
        /// <param name="value">Data to be displayed</param>
        /// <param name="name">Name of data</param>
        public Unknown(byte[] value, string name)
        {
            InitializeComponent();
            label1.Text = name;
            label2.Text = "Size: " + value.Length.ToString();
            textBox1.Text = value.ToString();
        }
        /// <summary>
        /// Returns the name of the controls value
        /// </summary>
        /// <returns></returns>
        public string ReturnName()
        {
            return label1.Text;
        }
        /// <summary>
        /// Expands and Contracts the control
        /// </summary>
        private void btnExpandContract_Click_1(object sender, EventArgs e)
        {
            if (btnExpandContract.Text == "+")
            {
                btnExpandContract.Text = "-";
                this.AutoSize = true;
            }
            else if (btnExpandContract.Text == "-")
            {
                btnExpandContract.Text = "+";
                this.AutoSize = false;
                this.Height = 31;
            }
        }
    }
}
