什么是[...]在C#
我在一些.Net框架代码中遇到此。我从来没有看到过。任何人都知道这意味着什么?
I encountered this in some .Net Framework code. I've never seen it before. Anyone know what it means?
switch(msgFlags)
{
case Message.[....]: // <-- never seen this before?
// do some stuff
}
修改我是通过我的一些代码,步进,当它引发了异常。唯一的例外在线路中的框架代码的某个地方爆发。我不记得现在在哪里的。这不是一个折叠的区域。本节在我与'标识应为错误编辑下划线。我想知道,如果它不是某种占位符,微软不希望任何人看到一些超级秘密的秘密松鼠代码。
I was stepping through some of my code, when it threw an exception. The exception broke on the lines somewhere in the Framework code. I can't remember now where at. This was not a collapsed region. The section is underlined in my editor with an 'Identifier Expected' error. I'm wondering if it isn't some kind of placeholder for some super-secret secret squirrel code that Microsoft doesn't want anyone to see.
我觉得你发现这RealProxy.cs。这看起来像一个搜索和替换错误。有几个地方的字符串会出现在这里:
I think you found this in RealProxy.cs. This looks like a search-and-replace mistake. There are several places where the string appears:
// NOTE: Keep this in [....] with unmanaged enum definition in Remoting.h
msgFlags = Message.[....];
// cannot support Async and end up doing a [....] call. We need
case Message.[....]:
看着相同的代码与反射,你看到正在使用的文字值0。这意味着Message.Dunno必须是一个常量的值。还有一个很好的匹配为,Message.Sync是太有//注意0值门当户对的私人常量:请记住这的同步的,并且//不能支持异步和最终做一个的同步的电话。
Looking at the same code with Reflector, you see the literal value 0 being used. Which means that Message.Dunno must be a const value. There's one good match for that, Message.Sync is a private const with the value 0. Good match too with // NOTE: Keep this in sync, and // cannot support Async and end up doing a Sync call.
这习惯说Message.Sync。
This used to say "Message.Sync".