2016-12-21 6 views
0

원래 using 지시문으로 작성된 파일을 완전히 정규화 된 이름으로 변환하려면 어떻게합니까?문을 정규화 된 이름으로 사용하여 코드 변환

예. 이

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) 
     { 
      ... 
} 
+0

실제 문제는 무엇입니까? 당신이 뭘하려고합니까? –

+0

@ 운이 좋은 [다른 누군가의 도서관] (https://github.com/pierredavidbelanger/chatter-bot-api)을 빌려서 내 프로젝트에서 사용하고 싶습니다. 내 프로젝트는 C# 스크립트를 즉시 실행하는 프로그램을 사용하고'using '지시문을 제대로 처리하지 않으므로 정규화 된 이름을 통해 모든 것을 지정해야합니다. – theonlygusti

+0

@theonlygusti 모든'using' 줄을 제거한 다음 각 컴파일 오류를 거치고 올바른 네임 스페이스로 경로를 지정하십시오. – Rob

답변

2
  • Install Resharper Tool

    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) 
         { 
          ... 
    } 
    

    에서 이동합니다.

  • 이동 ReSharper에서에 탭 => 옵션

    ...

  • 이동 코드에 대한 편집 섹션 => C# => 코드 스타일

  • 틱은 완전한 참조를 선호합니다. (변경 사항 저장)

  • 프로젝트를 마우스 오른쪽 버튼으로 클릭하고 정리 코드를 선택하십시오.

  • 전체 정리 선택을 선택하십시오. 전체 정리를 원하지 않으면 자신의 프로필을 만들고 적용 할 코딩 스타일 만 선택할 수 있습니다.)

+0

저는 Visual Studio를 실제로 사용하지 않고 있지만 좋은 대답이기 때문에 이것을 upvoted했습니다. – theonlygusti

+0

@theonlygusti 감사합니다. 저는 Visual Studio가 무거운 IDE이지만 실제로 그만한 가치가 있다는 것을 알고 있습니다. 특별히 resharper와 혼합했을 때. 한번 시도해보십시오 :) –