author | cavaliet |
Thu, 17 Sep 2009 17:25:05 +0200 | |
changeset 75 | 99d003723474 |
parent 54 | c724ac229181 |
child 135 | 84b3bf5ee3d2 |
child 143 | 9f157d9c725b |
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 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
20 |
actionDict.Add("ActionAddAnnotation", typeof(FingersDance.Actions.ActionAddAnnotation)); |
54 | 21 |
} |
22 |
||
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
23 |
public ActionBase GetAction(String T, Object Args) |
54 | 24 |
{ |
75
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
25 |
|
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
26 |
try |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
27 |
{ |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
28 |
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
|
29 |
return ab; |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
30 |
} |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
31 |
catch (Exception ex) { } |
99d003723474
data binding second step. we can add annotation by clicking on menu buttons or timeline.
cavaliet
parents:
54
diff
changeset
|
32 |
return null; |
54 | 33 |
} |
34 |
} |
|
35 |
} |