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

namespace Engineer.Forms
{
    public partial class NewUpdate : Form
    {
        public NewUpdate(Updating.UpdateInfo ui)
        {
            InitializeComponent();

            labelX1.Text = "Engineer " + ui.UpdateVersion.ToString();
            labelX3.Text = ui.UpdateDes;

            if (ui.UpdateImageLocation != "NULL")
                pictureBox1.ImageLocation = Updating.ServerUpdatePath + ui.UpdateImageLocation;

            foreach (Updating.Change change in ui.Changes)
            {
                string[] txt = new string[] { change.type.ToString(), change.Des, change.lvl.ToString() };
                ListViewItem lvi = new ListViewItem(txt);
                listViewEx1.Items.Add(lvi);
            }
        }

        private void buttonX2_Click(object sender, EventArgs e)
        {
            new Update().ShowDialog();
            this.Close();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}