fork download
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4. namespace WindowsFormsApplication1
  5. {
  6. public partial class Form1 : Form
  7. {
  8. public Lazy<Hage>[] hageArray = new Lazy<Hage>[1000];
  9. public Form1()
  10. {
  11. InitializeComponent();
  12.  
  13. for (int i = 0; i < hageArray.Length; i++)
  14. {
  15. hageArray[i] = new Lazy<Hage>();
  16. }
  17. }
  18.  
  19. private void button1_Click(object sender, EventArgs e)
  20. {
  21. int index;
  22. if (int.TryParse(textBox1.Text, out index))
  23. {
  24. var hage = hageArray[index].Value;
  25. hage.Property1 = "prop1";
  26. Console.WriteLine(hage.Property1);
  27. }
  28. }
  29.  
  30. }
  31.  
  32. public class Hage
  33. {
  34. public string Property1 { get; set; }
  35. public string Property2 { get; set; }
  36. }
  37. }
  38.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(2,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty