c# - 使用 using 语句将代码转换为完全限定名称

标签 c# mono xbuild

如何将最初使用 using 指令编写的文件转换为完全限定名称?

例如从

using System;
using System.Collections.Generic;
using System.Net;
using System.IO;
using System.Text;
using System.Xml.XPath;

namespace ChatterBotAPI
{
    public interface ChatterBotSession
    {
        ChatterBotThought Think(ChatterBotThought thought);
        string Think(string text);
    }

    internal class PandorabotsSession : ChatterBotSession
    {
        private readonly IDictionary<string, string> vars;

        public PandorabotsSession(string botid)
        {
            vars = new Dictionary<string, string>();
            vars["botid"] = botid;
            vars["custid"] = Guid.NewGuid().ToString();
        }

        public ChatterBotThought Think(ChatterBotThought thought)
        {
            ...
}

到此

namespace ChatterBotAPI
{
    public interface ChatterBotSession
    {
        ChatterBotThought Think(ChatterBotThought thought);
        string Think(string text);
    }

    internal class PandorabotsSession : ChatterBotSession
    {
        private readonly System.Collections.Generic.IDictionary<string, string> vars;

        public PandorabotsSession(string botid)
        {
            vars = new System.Collections.Generic.Dictionary<string, string>();
            vars["botid"] = botid;
            vars["custid"] = System.Guid.NewGuid().ToString();
        }

        public ChatterBotThought Think(ChatterBotThought thought)
        {
            ...
}

最佳答案

  • Install Resharper Tool .

  • 转到 Resharper 选项卡 => 选项...

  • 转到代码编辑部分 => C# => 代码样式

  • 勾选“首选完全合格的引用文献”。 (并保存更改)

  • 右键单击您的项目并选择清理代码。 (或按 Ctrl E + Ctrl C)

  • 选择“完全清理”即可开始(如果您不想完全清理,则可以创建自己的配置文件,并仅选择要应用的编码风格。)

关于c# - 使用 using 语句将代码转换为完全限定名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41254091/

相关文章:

c# - 请推荐一个Mono(即C#)的音频阅读库

mono - Assembly.GetExecutingAssembly() 在嵌入式单声道中不起作用?

c# - 串口通讯显示

c# - 使用 MonoTouch 显示多色字符串。 Three20、Nimbus 还是 UIWebView?

c# - 从 SQLITE PCL 获取特定月份的计数

ubuntu - Ubuntu 11.10 上的 Mono 2.10.5 运行时错误(可能是 log4net?)

visual-studio-2012 - 使用 Mono Compiler 时从 VisualStudio 2012 .sln 中排除 .csproj

regex - 带有 [System.Text.RegularExpressions.Regex]::Match(string,string) 参数的 xbuild 不能正常工作(MSBuild 很好)

c# - 在具有依赖项的 Linux 上编译 C# 项目

c# - WPF设计;一个窗口中的多个 View