ItemOperations 인터페이스

일반적인 파일 작업을 수행하는 개체입니다.

네임스페이스:  EnvDTE
어셈블리:  EnvDTE(EnvDTE.dll)

구문

‘선언
<GuidAttribute("D5DBE57B-C074-4E95-B015-ABEEAA391693")> _
Public Interface ItemOperations
[GuidAttribute("D5DBE57B-C074-4E95-B015-ABEEAA391693")]
public interface ItemOperations
[GuidAttribute(L"D5DBE57B-C074-4E95-B015-ABEEAA391693")]
public interface class ItemOperations
[<GuidAttribute("D5DBE57B-C074-4E95-B015-ABEEAA391693")>]
type ItemOperations =  interface end
public interface ItemOperations

ItemOperations 형식에서는 다음과 같은 멤버를 노출합니다.

속성

  이름 설명
Public 속성 DTE 최상위 확장성 개체를 가져옵니다.
Public 속성 Parent ItemOperations 개체의 바로 위 부모 개체를 가져옵니다.
Public 속성 PromptToSave 저장되지 않은 모든 파일을 가져온 다음 사용자가 하나 이상의 파일을 저장할 수 있도록 합니다.

위쪽

메서드

  이름 설명
Public 메서드 AddExistingItem 기존 항목을 현재 프로젝트에 추가합니다.
Public 메서드 AddNewItem 새 항목을 현재 프로젝트에 추가합니다.
Public 메서드 IsFileOpen 저장된 파일 중 특정 파일이 지정된 뷰에 현재 열려 있는지 여부를 나타냅니다.
Public 메서드 Navigate 지정한 URL로 이동합니다.
Public 메서드 NewFile IDE(통합 개발 환경)에서 새 파일 명령을 호출한 것처럼 파일을 만듭니다.
Public 메서드 OpenFile IDE(통합 개발 환경)에서 파일 열기 명령을 호출한 것처럼 파일을 엽니다.

위쪽

설명

ItemOperations 개체를 사용하여 프로그래밍 방식으로 항목을 열거나 솔루션 및 프로젝트에 항목을 추가할 수 있습니다. ItemOperations 메서드는 현재 선택된 항목에 대해서만 수행됩니다.

이 예제에서는 ItemOperations 개체를 통해 사용 가능한 모든 명령 이름이 나열된 텍스트 문서를 생성합니다.

예제

Sub ItemOperationsExample()
   Dim Cmds As Commands = DTE.Commands
   Dim Cmd As Command
   Dim Doc As Document
   Dim TxtDoc As TextDocument

   DTE.ItemOperations.NewFile("General\Text File")
   Doc = ActiveDocument
   TxtDoc = Doc.Object("TextDocument")

   For Each Cmd In Cmds
      If (Cmd.Name <> "") Then
         TxtDoc.Selection.Text = Cmd.Name & vbLf
         TxtDoc.Selection.Collapse()
      End If
   Next
End Sub

참고 항목

참조

EnvDTE 네임스페이스