src/FingersDance.Control.Menu/CustomSurfaceButton.cs
changeset 62 cbe5b01679a3
child 81 6b991b7e8046
equal deleted inserted replaced
61:9e2f007b19b3 62:cbe5b01679a3
       
     1 using System;
       
     2 using System.Collections.Generic;
       
     3 using System.Linq;
       
     4 using System.Text;
       
     5 using Microsoft.Surface;
       
     6 using Microsoft.Surface.Presentation;
       
     7 using Microsoft.Surface.Presentation.Controls;
       
     8 
       
     9 namespace FingersDance.Control.Menu
       
    10 {
       
    11     public class CustomSurfaceButton:SurfaceButton
       
    12     {
       
    13         string _Action = "";
       
    14         string _Ressource = "";
       
    15 
       
    16         public string Action
       
    17         {
       
    18             get { return _Action; }
       
    19             set { _Action = value; }
       
    20         }
       
    21 
       
    22         public string Ressource
       
    23         {
       
    24             get { return _Ressource; }
       
    25             set { _Ressource = value; }
       
    26         }
       
    27 
       
    28         public CustomSurfaceButton()
       
    29         {
       
    30             this.ContactDown += GenerateAction;
       
    31             this.Click += GenerateAction;
       
    32         }
       
    33 
       
    34         private void GenerateAction(Object sender, EventArgs Event)
       
    35         {
       
    36             try
       
    37             {
       
    38                 ActionFactory.ActionGenerator AG = (new ActionFactory.ActionFactory()).GetGenerator();
       
    39                 FingersDance.Actions.ActionBase action = AG.GetAction("Action" + ((CustomSurfaceButton)sender).Content, null);
       
    40                 if (action != null)
       
    41                 {
       
    42                     //action.Execute();
       
    43                     //this.debug.addToList(action.GetType().ToString());
       
    44                 }
       
    45             }
       
    46             catch (Exception e) { }
       
    47         }
       
    48     }
       
    49 }