35
|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using FingersDance.Control.Player; |
38
|
6 |
using FingersDance.Actions; |
35
|
7 |
|
|
8 |
namespace FingersDance.ActionFactory |
|
9 |
{ |
|
10 |
public class ActionFactory |
|
11 |
{ |
|
12 |
private Dictionary<String, Type> actionDict = new Dictionary<string, Type>(); |
|
13 |
|
|
14 |
public ActionFactory() |
|
15 |
{ |
36
|
16 |
actionDict.Add("ActionPlayMedia", Type.GetType("FingersDance.Actions.ActionPlayMedia")); |
35
|
17 |
} |
38
|
18 |
|
|
19 |
public ActionBase GetAction(string T, object Args) |
|
20 |
{ |
|
21 |
try |
|
22 |
{ |
|
23 |
return (ActionBase)Activator.CreateInstance(actionDict[T]); |
|
24 |
} |
|
25 |
catch (Exception) |
|
26 |
{ |
|
27 |
return null; |
|
28 |
} |
|
29 |
} |
35
|
30 |
} |
|
31 |
} |