c# - Initializing a List into a static method -


i have 6 operators trying push operator class. need initialise list of new operators can used effectively. i've got myself in quite mess , having fair few syntax problems, appreciated in creating list.

public static list<comparisonoperator> createcomparisonoperators()           {         this.condition1select.items.clear();         this.condition2select.items.clear();         this.condition3select.items.clear();         this.condition4select.items.clear();           foreach (comparisonoperator op in ops)         {             this.condition1select.items.add(op);             this.condition2select.items.add(op);             this.condition3select.items.add(op);             this.condition4select.items.add(op);         }           return new list<comparisonoperator>();     } 

the thisstatement means refer current instance. static methods don't have instance , can't use thisstatement. need make liststatic, too. comparisonoperator enumeration opsneeds static.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -