That code isn't Java, it's a feeble attempt at C#; better ask at a Microsoft site.

kind regards,

Jos