using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Surface;
using Microsoft.Surface.Presentation;
using Microsoft.Surface.Presentation.Controls;

namespace FingersDance.Control.Menu
{
    public class CustomSurfaceButton:SurfaceButton
    {
        string _Action = "";
        string _Ressource = "";

        public string Action
        {
            get { return _Action; }
            set { _Action = value; }
        }

        public string Ressource
        {
            get { return _Ressource; }
            set { _Ressource = value; }
        }

        public CustomSurfaceButton()
        {
            this.ContactDown += GenerateAction;
            this.Click += GenerateAction;
        }

        private void GenerateAction(Object sender, EventArgs Event)
        {
            try
            {
                ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator();
                FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((CustomSurfaceButton)sender).Content, null);
                if (action != null)
                {
                    //action.Execute();
                    //this.debug.addToList(action.GetType().ToString());
                }
            }
            catch (Exception e) { }
        }
    }
}
