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

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

        我可以将静态类作为命名空间导入以调用其方法,而无需在 C# 中指定类名吗?

        时间:2023-09-16

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

              • <legend id='dwVUu'><style id='dwVUu'><dir id='dwVUu'><q id='dwVUu'></q></dir></style></legend>

                <tfoot id='dwVUu'></tfoot>
                1. <small id='dwVUu'></small><noframes id='dwVUu'>

                  本文介绍了我可以将静态类作为命名空间导入以调用其方法,而无需在 C# 中指定类名吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我广泛使用了一个特定静态类的成员函数.每次调用它的方法时都指定类名看起来很讨厌......

                  I make extensive use of member functions of one specific static class. Specifying the class name every time I call it's methods looks nasty...

                  我可以在不指定类名 C# 的情况下将静态类作为命名空间来调用其方法吗?

                  Can I import a static class as a namespace to call its methods without specifying the class name C#?

                  推荐答案

                  如果你的意思是导入它使得它的方法是全局的,不.

                  If you mean import it such that it's methods are global, no.

                  不过,您可能想查看扩展方法.它们是静态方法,当它们的类的命名空间被导入时,它们会在它们的第一个参数的类型上显示为实例方法.在此处查看更多信息:http://msdn.microsoft.com/en-us/library/bb383977.aspx

                  You might want to look at extension methods though. They are static methods that, when their class's namespace is imported, show up as instance methods on the type of their first argument. See more here: http://msdn.microsoft.com/en-us/library/bb383977.aspx

                  这篇关于我可以将静态类作为命名空间导入以调用其方法,而无需在 C# 中指定类名吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:没有 xmlns 的序列化 下一篇:.NET 命名空间和 using 语句

                  相关文章

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

                    1. <legend id='nD93G'><style id='nD93G'><dir id='nD93G'><q id='nD93G'></q></dir></style></legend><tfoot id='nD93G'></tfoot>

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