什么是[...]在C# [英] What is [....] in C#

查看:128
本文介绍了什么是[...]在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".

这篇关于什么是[...]在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆