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

namespace DiagramUI
{
    public partial class FormDataTable : Form
    {
        private DataTable table;

        private FormDataTable()
        {
            InitializeComponent();
        }

        public FormDataTable(DataTable table)
        {
            InitializeComponent();
            this.table = table;
            Set();
        }

        public FormDataTable(XmlElement e, string tag, string[] attributes)
        {
            InitializeComponent();
            table = PureDesktop.CreateTable(e, tag, attributes);
            Set();
        }


        public DataTable Teble
        {
            get { return table; }
        }


        private void Set()
        {
            dataGridViewTable.DataSource = table;
        }

        private void buttonOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
            Close();
        }

        private void buttonCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
            Close();
        }
    }
}