XML:<class> <method>a1</method> <class>
C#:
Class Demo
{
public string a1 { get; set;}
public void a1()
{
-----
}
}
class test
{
public static void main(string args[])
{
Demo d = new Demo();
d.a1();
}
}
C# 已编译,并将在另一个程序中作为参考。
如果我添加一个新的 XML 方法,比如a2
after a1
,我可以在运行时使用 dynamic 和 expandos 获得这个方法吗?如果可能,请告诉我该怎么做。
另一件事是,该方法能否在运行时根据 XML 文件动态创建。例如,如果d.a1()
包含,<method>c1</method>
那么它将d.c1()
从 Intellisense 中显示。