내용으로 건너뛰기
GINS WIKI 긴스 위키
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
현재 위치:
긴스위키 GINS wiki
»
툴 tools
»
비주얼 스튜디오 Visual Studio
»
Macro : Header Source Toggle
추적:
tool:microsoft-visual-studio:매크로
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== Macro : Header Source Toggle ====== * 출처 : [[http://bytedevil.tistory.com/7|20Visual Studio에서 *.c, *.cpp(소스) 와 *.h, *.hpp(헤더) 전환하기]] - Alt+F11 로 매크로 편집기 오픈 - 아래 매크로를 추가 - 키보드 설정에서, "매크로." 또는 "Macro." 를 타이핑 해서 내가 작성한 매크로 찾기 - 키 할당 - 사용하기 ++++ 코드 보기 | <code vbnet> Public Sub toggleHeaderSource() Dim currentDocumentPath As String = DTE.ActiveDocument.FullName currentDocumentPath = currentDocumentPath.ToLower() Dim currentDocumentPathWithoutExtension As String = currentDocumentPath.Remove(currentDocumentPath.LastIndexOf(".")) Dim correspondingDocumentPath As String Dim correspondingDocumentPath2 As String If (currentDocumentPath.EndsWith(".c") Or currentDocumentPath.EndsWith(".cpp")) Then correspondingDocumentPath = currentDocumentPathWithoutExtension + ".hpp" correspondingDocumentPath2 = currentDocumentPathWithoutExtension + ".h" ElseIf (currentDocumentPath.EndsWith(".h") Or currentDocumentPath.EndsWith(".hpp")) Then correspondingDocumentPath = currentDocumentPathWithoutExtension + ".cpp" correspondingDocumentPath2 = currentDocumentPathWithoutExtension + ".c" End If If (System.IO.File.Exists(correspondingDocumentPath) = True) Then DTE.ExecuteCommand("File.OpenFile", correspondingDocumentPath) ElseIf (System.IO.File.Exists(correspondingDocumentPath2) = True) Then DTE.ExecuteCommand("File.OpenFile", correspondingDocumentPath2) End If End Sub </code> ++++ ====== Visual Studio 매크로 ====== VS2010에는 플러그인 개발이 오픈소스화 되어 좋은 것들을 쉽게 구할 수 있게 되었다. 뭔가 불편하면, 플러그인을 찾으면 된다. 이 스크립트는 낡았다. 그냥 추억으로 나둠. ++++ Old Script | <code vb> Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports EnvDTE90a Imports EnvDTE100 Imports System.Diagnostics Public Module MyMacroModule Public Sub toggleHeaderSource() Dim currentDocumentPath As String = DTE.ActiveDocument.FullName currentDocumentPath = currentDocumentPath.ToLower() Dim currentDocumentPathWithoutExtension As String = currentDocumentPath.Remove(currentDocumentPath.LastIndexOf(".")) Dim correspondingDocumentPath As String Dim correspondingDocumentPath2 As String If (currentDocumentPath.EndsWith(".c") Or currentDocumentPath.EndsWith(".cpp")) Then correspondingDocumentPath = currentDocumentPathWithoutExtension + ".hpp" correspondingDocumentPath2 = currentDocumentPathWithoutExtension + ".h" ElseIf (currentDocumentPath.EndsWith(".h") Or currentDocumentPath.EndsWith(".hpp")) Then correspondingDocumentPath = currentDocumentPathWithoutExtension + ".cpp" correspondingDocumentPath2 = currentDocumentPathWithoutExtension + ".c" End If If (System.IO.File.Exists(correspondingDocumentPath) = True) Then DTE.ExecuteCommand("File.OpenFile", correspondingDocumentPath) ElseIf (System.IO.File.Exists(correspondingDocumentPath2) = True) Then DTE.ExecuteCommand("File.OpenFile", correspondingDocumentPath2) End If End Sub Sub InsertTMacro() Dim selection As EnvDTE.TextSelection Dim startPoint As EnvDTE.EditPoint Dim endPoint As TextPoint Dim commentStart As String selection = DTE.ActiveDocument.Selection() startPoint = selection.TopPoint.CreateEditPoint() endPoint = selection.BottomPoint.CreateEditPoint() DTE.UndoContext.Open("InsertTMacro") Try startPoint.Insert("_T(") endPoint.Insert(")") Finally DTE.UndoContext.Close() End Try End Sub End Module </code> ++++
tool/microsoft-visual-studio/매크로.txt
· 마지막으로 수정됨: 2024/04/23 22:44 저자
127.0.0.1
문서 도구
문서 보기
이전 판
역링크
맨 위로