这是在支持IL水平,但不是在C#。你可以看看不受约束的旋律通过乔恩斯基特写,让你实现这个。而这里的相应博客文章在那里,他解释细节。
This is supported at the IL level but not in C#. You may take a look at unconstrained melody written by Jon Skeet which allows you to achieve that. And here's the corresponding blog post where he explains in details.