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

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -