1. <legend id='Sl3IM'><style id='Sl3IM'><dir id='Sl3IM'><q id='Sl3IM'></q></dir></style></legend>
      <i id='Sl3IM'><tr id='Sl3IM'><dt id='Sl3IM'><q id='Sl3IM'><span id='Sl3IM'><b id='Sl3IM'><form id='Sl3IM'><ins id='Sl3IM'></ins><ul id='Sl3IM'></ul><sub id='Sl3IM'></sub></form><legend id='Sl3IM'></legend><bdo id='Sl3IM'><pre id='Sl3IM'><center id='Sl3IM'></center></pre></bdo></b><th id='Sl3IM'></th></span></q></dt></tr></i><div id='Sl3IM'><tfoot id='Sl3IM'></tfoot><dl id='Sl3IM'><fieldset id='Sl3IM'></fieldset></dl></div>
      <tfoot id='Sl3IM'></tfoot>

      <small id='Sl3IM'></small><noframes id='Sl3IM'>

        <bdo id='Sl3IM'></bdo><ul id='Sl3IM'></ul>
    1. 为什么在 C# 中使用 global 关键字?

      Why use the global keyword in C#?(为什么在 C# 中使用 global 关键字?)
      <i id='D4NMv'><tr id='D4NMv'><dt id='D4NMv'><q id='D4NMv'><span id='D4NMv'><b id='D4NMv'><form id='D4NMv'><ins id='D4NMv'></ins><ul id='D4NMv'></ul><sub id='D4NMv'></sub></form><legend id='D4NMv'></legend><bdo id='D4NMv'><pre id='D4NMv'><center id='D4NMv'></center></pre></bdo></b><th id='D4NMv'></th></span></q></dt></tr></i><div id='D4NMv'><tfoot id='D4NMv'></tfoot><dl id='D4NMv'><fieldset id='D4NMv'></fieldset></dl></div>
        1. <legend id='D4NMv'><style id='D4NMv'><dir id='D4NMv'><q id='D4NMv'></q></dir></style></legend>

            <bdo id='D4NMv'></bdo><ul id='D4NMv'></ul>
            <tfoot id='D4NMv'></tfoot>

            <small id='D4NMv'></small><noframes id='D4NMv'>

                  <tbody id='D4NMv'></tbody>
              • 本文介绍了为什么在 C# 中使用 global 关键字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我想了解您为什么要使用 global:: 前缀.在以下代码中,ReSharper 将其标识为多余的,并且可以删除:

                I would like to understand why you might want to use the global:: prefix. In the following code, ReSharper is identifying it as redundant, and able to be removed:

                推荐答案

                最好在生成的代码中使用全局命名空间前缀.这样做是为了避免命名空间中存在类似命名类型的情况.

                It is best to use the global namespace prefix in generated code. This is done to avoid situations where a similar named type exists in your namespace.

                如果您创建一个名为 System.Diagnostics.DebuggerNonUserCodeAttribute inside your namespace 的类型,您会注意到 ReSharper 不再说 global:: 不需要.代码生成器只是想避免与您自己的类型名称发生任何冲突.

                If you create a type named System.Diagnostics.DebuggerNonUserCodeAttribute inside your namespace you will notice that ReSharper no longer says that the global:: is not needed. The code generator simply wants to avoid any collisions with the names of your own types.

                这篇关于为什么在 C# 中使用 global 关键字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                C# namespace alias - what#39;s the point?(C# 命名空间别名 - 有什么意义?)
                Using Xpath With Default Namespace in C#(在 C# 中使用具有默认命名空间的 Xpath)
                IBM.Data.DB2.Core connection problems(IBM.Data.DB2.Core 连接问题)
                Generating an EDMX from a DB2 Database(从 DB2 数据库生成 EDMX)
                Datetime field overflow with IBM Data Server Client v9.7fp5(IBM Data Server Client v9.7fp5 的日期时间字段溢出)
                Using entity Framework with .NET Core and DB2(将实体框架与 .NET Core 和 DB2 结合使用)

                    • <bdo id='TmfKL'></bdo><ul id='TmfKL'></ul>

                      <small id='TmfKL'></small><noframes id='TmfKL'>

                      <i id='TmfKL'><tr id='TmfKL'><dt id='TmfKL'><q id='TmfKL'><span id='TmfKL'><b id='TmfKL'><form id='TmfKL'><ins id='TmfKL'></ins><ul id='TmfKL'></ul><sub id='TmfKL'></sub></form><legend id='TmfKL'></legend><bdo id='TmfKL'><pre id='TmfKL'><center id='TmfKL'></center></pre></bdo></b><th id='TmfKL'></th></span></q></dt></tr></i><div id='TmfKL'><tfoot id='TmfKL'></tfoot><dl id='TmfKL'><fieldset id='TmfKL'></fieldset></dl></div>
                          <tbody id='TmfKL'></tbody>
                        <tfoot id='TmfKL'></tfoot>

                        <legend id='TmfKL'><style id='TmfKL'><dir id='TmfKL'><q id='TmfKL'></q></dir></style></legend>