# HG changeset patch # User PAMPHILE Jonathan # Date 1249478544 -7200 # Node ID e4864c53abe251132a22f02c20994f818cb0f54c # Parent a71a1bab56a9ec449fc7941dc0859d7363f48d65 Test des menus diff -r a71a1bab56a9 -r e4864c53abe2 src/FingersDance.Actions/ActionBase.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Actions/ActionBase.cs Wed Aug 05 15:22:24 2009 +0200 @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace FingersDance.Actions +{ + public interface ActionBase + { + void Execute(); + } +} diff -r a71a1bab56a9 -r e4864c53abe2 src/FingersDance.Actions/ActionGenerator.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Actions/ActionGenerator.cs Wed Aug 05 15:22:24 2009 +0200 @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace FingersDance.Actions +{ + public class ActionGenerator + { + public Object GetAction(Type T, object Args) + { + return Activator.CreateInstance(T); + } + } +} diff -r a71a1bab56a9 -r e4864c53abe2 src/FingersDance.Actions/ActionPlayMedia.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Actions/ActionPlayMedia.cs Wed Aug 05 15:22:24 2009 +0200 @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace FingersDance.Actions +{ + class ActionPlayMedia : ActionBase + { + public void Execute() + { + + } + } +} diff -r a71a1bab56a9 -r e4864c53abe2 src/FingersDance.Actions/FingersDance.Actions.idc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/FingersDance.Actions/FingersDance.Actions.idc Wed Aug 05 15:22:24 2009 +0200 @@ -0,0 +1,1 @@ + diff -r a71a1bab56a9 -r e4864c53abe2 test/TestMenu/TestMenu/ActionFactory.cs --- a/test/TestMenu/TestMenu/ActionFactory.cs Wed Aug 05 14:28:46 2009 +0200 +++ b/test/TestMenu/TestMenu/ActionFactory.cs Wed Aug 05 15:22:24 2009 +0200 @@ -11,7 +11,7 @@ { try { - return (ActionBase)Activator.CreateInstance(T); + return (ActionBase)Activator.CreateInstance(T, Arg); } catch (Exception ex) { diff -r a71a1bab56a9 -r e4864c53abe2 test/TestMenu/TestMenu/SurfaceWindow1.xaml.cs --- a/test/TestMenu/TestMenu/SurfaceWindow1.xaml.cs Wed Aug 05 14:28:46 2009 +0200 +++ b/test/TestMenu/TestMenu/SurfaceWindow1.xaml.cs Wed Aug 05 15:22:24 2009 +0200 @@ -41,6 +41,9 @@ // Add handlers for Application activation events AddActivationHandlers(); + ActionBase action = (new ActionFactory()).GenerateAction(Type.GetType("TestMenu" + ".ActionShowMessage"), "ok"); + if (action != null) + action.Execute(); } public SurfaceMenuItem CreateMenuItem(Item item)