using System;
using System.Windows.Forms;
using System.Collections;

//using SpatialUI;
using DiagramUI;
using DataPerformer;

using CategoryTheory;

namespace DataPerformerUI
{
	public class HeaderControl
	{
		protected static HeaderControl header;

		public virtual Control GetHeaderControl(IMeasurements mea)
		{
			Control c = GetHeaderControlStatic(mea);
			IAssociatedObject o = mea as IAssociatedObject;
			if (c == null)
			{
				return new ObjectPanel(o.Object as IObjectLabel);
			}
			return c;
		}

		
		static protected Control GetHeaderControlStatic(IMeasurements mea)
		{
			IAssociatedObject o = mea as IAssociatedObject;
			/*if (o is FormulaDataConsumer)
			{
				FormulaDataConsumer fdc = o as FormulaDataConsumer;
				return new FormulaControl(fdc);
			}*/
			return new ObjectPanel(o.Object as IObjectLabel);
		}

		public static HeaderControl Object
		{
			get
			{
				return header;
			}
			set
			{
				header = value;
			}
		}
	}
}