author | PAMPHILE Jonathan <pamphile@efrei.fr> |
Tue, 13 Oct 2009 19:33:13 +0200 | |
changeset 143 | 9f157d9c725b |
parent 75 | 99d003723474 |
child 146 | dd8ed4d3beb6 |
permissions | -rw-r--r-- |
54 | 1 |
using System; |
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using FingersDance.Actions; |
|
6 |
||
7 |
namespace FingersDance.ActionFactory |
|
8 |
{ |
|
9 |
public class ActionGenerator |
|
10 |
{ |
|
11 |
private Dictionary<String, Type> actionDict = new Dictionary<string, Type>(); |
|
12 |
||
13 |
public ActionGenerator() |
|
14 |
{ |
|
15 |
actionDict.Add("ActionPlayMedia", typeof(FingersDance.Actions.ActionPlayMedia)); |
|
16 |
actionDict.Add("ActionShowMessage", typeof(FingersDance.Actions.ActionShowMessage)); |
|
17 |
actionDict.Add("ActionOpenMedia", typeof(FingersDance.Actions.ActionOpenMedia)); |
|
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
18 |
actionDict.Add("ActionStopMedia", typeof(FingersDance.Actions.ActionStopMedia)); |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
19 |
|
143 | 20 |
//actionDict.Add("ActionStartOrEndAnnotation", typeof(FingersDance.Actions.ActionStartOrEndAnnotation)); |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
21 |
actionDict.Add("ActionAddAnnotation", typeof(FingersDance.Actions.ActionAddAnnotation)); |
54 | 22 |
} |
23 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
24 |
public ActionBase GetAction(String T, Object Args) |
54 | 25 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
26 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
27 |
try |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
28 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
29 |
ActionBase ab = (ActionBase)Activator.CreateInstance(actionDict[T], Args); |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
30 |
return ab; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
31 |
} |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
32 |
catch (Exception ex) { } |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
33 |
return null; |
54 | 34 |
} |
35 |
} |
|
36 |
} |