2012-10-12 34 views

回答

2

你可以看看Reflection API是如何實現的,它實際上非常簡單,它只是創建一個RootElement,然後用它需要的各種值填充它。

事情是這樣的:

var section = new Section ("My Section"); 
for (int i = 0; i < 32; i++){ 
    section.Add (new RadioElement ("Element " + i)); 
} 

var myRadio = new RootElement ("My Radio", new RadioGroup (null, 0)) { 
    section 
};