21 {
23 {
24 string name = inf.DeclaringType.FullName.Replace("<", "").Replace("+",".");
25 if(name.Contains('<'))
26 name = name.Substring(0, name.LastIndexOf('>'));
27 string code = name + "." + inf.Name + "(";
28 for (int i = 0; i < args.Length; i++)
29 {
30 Type t = args[i].GetType();
31 if (args[i] is Array)
32 {
33 Array ar = (Array)args[i];
34 code += "";
35 for (int a = 0; a < ar.Length; a++)
36 {
37 if (t == typeof(string))
38 {
39 if (i == 0)
40 code += "new " + t.Name + "[]{\"" + ar.GetValue(a).ToString() + "\"";
41 else
42 code += ",\"" + ar.GetValue(a).ToString() + "\"";
43 if (i == ar.Length - 1)
44 code += ";";
45 }
46 else
47 if (t == typeof(bool))
48 {
49 if (i == 0)
50 code += "new " + "bool" + "[]{" + ar.GetValue(a).ToString().ToLower();
51 else
52 code += ",\"" + ar.GetValue(a).ToString() + "\"";
53 if (i == ar.Length - 1)
54 code += "}";
55 }
56 else
57 {
58 if (i == 0)
59 code += "new " + t.Name + "{\"" + ar.GetValue(a).ToString() + "\"";
60 else
61 code += "," + ar.GetValue(a).ToString();
62 if (i == ar.Length - 1)
63 code += "}";
64 }
65 }
66 }
67 else
68 if (t == typeof(string))
69 {
70 if (i == 0)
71 code += "\"" + args[i].ToString() + "\"";
72 else
73 code += ",\"" + args[i].ToString() + "\"";
74 }
75 else
76 if (t == typeof(bool))
77 {
78 if (i == 0)
79 code += args[i].ToString().ToLower();
80 else
81 code += "," + args[i].ToString().ToLower();
82 }
83 else
84 if (i == 0)
85 code += args[i];
86 else
87 code += "," + args[i];
88 }
89 code += ");";
90 Console.WriteLine(code);
91 rec.Add(code);
92 }
93 }