Note that there are some explanatory texts on larger screens.

plurals
  1. POloop through a collection of classes and recognize them for adding a new one
    primarykey
    data
    text
    <p>I've got a set of classes with propperties and a main class which has lists of the set of classes.</p> <pre><code>public class MainClass { public List&lt;ClassA&gt; listA {get;set;} public List&lt;ClassB&gt; listB {get;set;} public List&lt;ClassC&gt; listC {get;set;} public object[] loop = {listA, listB, listC}; } class ClassA { public Guid id {get;set;} public string text {get;set;} public int number {get;set} public status {get;set;} public object[] loop = {id, text, number}; } class ClassB { public Guid id {get;set;} public string text {get;set;} public Image pic {get;set} public status {get;set;} public object[] loop = {id, text, pic}; } class ClassC { public Guid id {get;set;} public byte[] data {get;set;} public DateTime date {get;set;} public status {get;set;} public object[] loop = {id, data, date}; } public enum status { nothing=0, instert=1, delete=2, edit=3 } </code></pre> <p>Situation has changed since yesterday but still, i'd like to index my class, my idea was by adding this line:</p> <pre><code>public object[] loop = {listA, listB, listC}; </code></pre> <p>to MainClass, archieving this goal, after changing the whole thing to an non static class it seems forbidden. also when i was trying this with a static class i cant adress my lists directly. could this be done any how?</p> <p>finaly i want to adress a specific property inside the list like this:</p> <pre><code>MainClass mc = new MainClass(); DateTime dt = mc.loop[2][5].loop[2]; </code></pre> <p>even if it would be nicer to do this without the loop property, like:</p> <pre><code>DateTime dt = mc[2][5][2]; </code></pre> <p>how i want to loop it finaly:</p> <pre><code>for(int i=0; i&lt;mc.loop.count(); i++) { for (int j=0; j&lt;mc.loop[i].Count(); i++) { switch(mc.loop[i][j].loop[3]) { case: delete doSomething1(mc.loop[i][j]) case: insert doSomething2(mc.loop[i][j]) case: edit doSomething3(mc.loop[i][j]) default break; } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload