Updated addDeclaredFields to C#