using System;
using System.Windows .Forms ;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Lazy< Hage> [ ] hageArray = new Lazy< Hage> [ 1000 ] ;
public Form1( )
{
InitializeComponent( ) ;
for ( int i = 0 ; i < hageArray.Length ; i++ )
{
hageArray[ i] = new Lazy< Hage> ( ) ;
}
}
private void button1_Click( object sender, EventArgs e)
{
int index;
if ( int .TryParse ( textBox1.Text , out index) )
{
var hage = hageArray[ index] .Value ;
hage.Property1 = "prop1" ;
Console.WriteLine ( hage.Property1 ) ;
}
}
}
public class Hage
{
public string Property1 { get; set; }
public string Property2 { get; set; }
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uV2luZG93cy5Gb3JtczsKCm5hbWVzcGFjZSBXaW5kb3dzRm9ybXNBcHBsaWNhdGlvbjEKewogICAgcHVibGljIHBhcnRpYWwgY2xhc3MgRm9ybTEgOiBGb3JtCiAgICB7CiAgICAgICAgcHVibGljIExhenk8SGFnZT5bXSBoYWdlQXJyYXkgPSBuZXcgTGF6eTxIYWdlPlsxMDAwXTsKICAgICAgICBwdWJsaWMgRm9ybTEoKQogICAgICAgIHsKICAgICAgICAgICAgSW5pdGlhbGl6ZUNvbXBvbmVudCgpOwoKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBoYWdlQXJyYXkuTGVuZ3RoOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGhhZ2VBcnJheVtpXSA9IG5ldyBMYXp5PEhhZ2U+KCk7CiAgICAgICAgICAgIH0KICAgICAgICB9CgogICAgICAgIHByaXZhdGUgdm9pZCBidXR0b24xX0NsaWNrKG9iamVjdCBzZW5kZXIsIEV2ZW50QXJncyBlKQogICAgICAgIHsKICAgICAgICAgICAgaW50IGluZGV4OwogICAgICAgICAgICBpZiAoaW50LlRyeVBhcnNlKHRleHRCb3gxLlRleHQsIG91dCBpbmRleCkpCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIHZhciBoYWdlID0gaGFnZUFycmF5W2luZGV4XS5WYWx1ZTsKICAgICAgICAgICAgICAgIGhhZ2UuUHJvcGVydHkxID0gInByb3AxIjsKICAgICAgICAgICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKGhhZ2UuUHJvcGVydHkxKTsKICAgICAgICAgICAgfQogICAgICAgIH0KCiAgICB9CgogICAgcHVibGljIGNsYXNzIEhhZ2UKICAgIHsKICAgICAgICBwdWJsaWMgc3RyaW5nIFByb3BlcnR5MSB7IGdldDsgc2V0OyB9CiAgICAgICAgcHVibGljIHN0cmluZyBQcm9wZXJ0eTIgeyBnZXQ7IHNldDsgfQogICAgfQp9Cg==
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