using System;
using schema = Jhu.Graywulf.Schema;

namespace CasJobsWeb.schema
{
    public partial class IndexList : System.Web.UI.UserControl
    {
        protected schema::IIndexes databaseObject;

        public schema::IIndexes DatabaseObject
        {
            get { return databaseObject; }
            set
            {
                databaseObject = value;
                if (value == null)
                {
                    listView.DataSource = null;
                    listView.DataBind();
                }
                RefreshForm();
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            RefreshForm();
        }

        private void RefreshForm()
        {
            if (databaseObject != null)
            {
                listView.DataSource = databaseObject.Indexes.Values;
                listView.DataBind();
            }
        }
    }
}