简体   繁体   English

如何在C#Express 2008中添加名称空间?

[英]How can I add a namespace in C# Express 2008?

Right now everything falls in this namespace: 现在,所有内容都属于此命名空间:

XXX.YYY.(varies) XXX.YYY。(可变)

It's an open source project and I'm refactoring it to suit our needs. 这是一个开源项目,我正在对其进行重构以适应我们的需求。 That part works fine, but I need to add another namespace after YYY for organizational reasons. 该部分工作正常,但出于组织原因,我需要在YYY之后添加另一个名称空间。 So every single class will read XXX.YYY.ZZZ.(varies) How can I do that? 所以每个班级都会读XXX.YYY.ZZZ。(可变)我该怎么做?

In your code file, just change it: 在您的代码文件中,只需对其进行更改:

namespace XXX.YYY.ZZZ
{
    /* your types that go in that namespace */
}

(typically still only one class / etc per file) (每个文件通常通常只有一个类/ etc)

If you are moving all of them, then find+replace may help ( ctrl + h ) 如果要移动所有这些,然后找到+取代可以帮助(Ctrl + H

You should also be able to use the "class view" to help track them: View => Class View, or ctrl + w , c 您还应该能够使用“类视图”来帮助跟踪它们:View => Class View,或ctrl + wc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用Visual C#Express 2008制作图表? - How can I make a chart with visual c# express 2008? 如何将通用C#代码添加到Visual C#2008 Express项目/解决方案? - How do I add common C# code to a Visual C# 2008 Express project/solution? 视觉C# 2008 express无法添加资源? - Can't add resources to visual C# 2008 express? 如何在 C# 中将命名空间添加到 soap 信封 - How can I add a namespace to soap envelope in c# 如何使用Add-Type通过System.Windows.Forms命名空间添加C#代码? - How can I Use Add-Type to add C# code with System.Windows.Forms namespace? 如何使用C#以编程方式获取SQL Server 2008 Express R2的默认备份路径? - How can I obtain the default backup path for SQL Server 2008 Express R2 programmatically using C#? 如何将名称空间仅添加到C#中的ref元素? - How do I add a namespace to only ref elements in C#? 我可以使用Microsoft Visual C#Express 2008制作WCF应用程序吗? - Can I make WCF applications using Microsoft Visual C# Express 2008? 如何将VS命令提示符添加到Visual Studio 2010 C#Express? - How can I add the VS Command Prompt to Visual Studio 2010 C# Express? 在C#中,如何将空检查添加到动态快递代码中 - In C#, how can i add a null check into dynamic express code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM