-5

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();
     }
    }

The C# is compiled and it will be made as reference in another program.

If I add a new XML method, like a2 after a1, can I get this method in run time using dynamic and expandos. If possible, please tell me how to do it.

Another thing, can that method be dynamically created at runtime as per XML file. For example, if d.a1() contains <method>c1</method> then it will show d.c1() from Intellisense.

unbindall
  • 514
  • 1
  • 13
  • 29

1 Answers1

0

You better use dynamic libraries and reference them at runtime. See Can I load a .NET assembly at runtime and instantiate a type knowing only the name?

Community
  • 1
  • 1
theknut
  • 2,533
  • 5
  • 26
  • 41