fork download
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. public class Test
  5. {
  6.  
  7.  
  8. public static void Main()
  9. {
  10. List<string> Channels = new List<string>() {"a","b", "c"};
  11. AddChannel ac = new AddChannel(Channels);
  12. ac.AddSomthing("foo");
  13.  
  14. foreach(var s in Channels)
  15. {
  16. Console.WriteLine(s);
  17. }
  18.  
  19. }
  20.  
  21.  
  22. }
  23. public class AddChannel
  24. {
  25. private List<string> Channels {get;set;}
  26. public AddChannel(List<string> Channels )
  27. {
  28. this.Channels = Channels ;
  29. }
  30.  
  31. public void AddSomthing(string s)
  32. {
  33. this.Channels.Add(s);
  34. }
  35.  
  36. }
Success #stdin #stdout 0.02s 33880KB
stdin
Standard input is empty
stdout
a
b
c
foo