How to update the whole list when just one element is modified outside in a class in c#? -


class foo {     public list<object> mylist;      public int num;     public string name;     public bool isit;       public foo()     {          mylist = new list<object>();         mylist.add(num);         mylist.add(name);         mylist.add(isit);     } }   class program {     static void main(string[] args)     {          foo = new foo();         my.isit = true;         my.mylist[0] = 5;         my.mylist[1] = "hello";         console.writeline("" + my.mylist[2]);  => returns false instead of true         console.readline();      } } 

assuming list have item @ index 2:

    private bool _isit;      public list<object> mylist;      public bool isit{       get{return _isit;}       set{          _isit = value;          mylist[2] = value;        }      } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -