ItemOperations ItemOperations ItemOperations ItemOperations ItemOperations ItemOperations Interface

Definition

Object for performing common file actions.

public interface class ItemOperations
public interface class ItemOperations
__interface ItemOperations
[System.Runtime.InteropServices.Guid("D5DBE57B-C074-4E95-B015-ABEEAA391693")]
[System.Runtime.InteropServices.TypeLibType(4160)]
public interface ItemOperations
type ItemOperations = interface
Public Interface ItemOperations
Attributes

Examples

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  

Remarks

You can use the ItemOperations object to programmatically open or add items to your solution and projects. Note that ItemOperations methods act upon only the currently selected item.

This example uses the ItemOperations object to generate a text document listing all available command names.

Properties

DTE DTE DTE DTE DTE DTE

Gets the top-level extensibility object.

Parent Parent Parent Parent Parent Parent

Gets the immediate parent object of an ItemOperations object.

PromptToSave PromptToSave PromptToSave PromptToSave PromptToSave PromptToSave

Gets all unsaved files and allows the user to save one or more of them.

Methods

AddExistingItem(String) AddExistingItem(String) AddExistingItem(String) AddExistingItem(String) AddExistingItem(String) AddExistingItem(String)

Adds an existing item to the current project.

AddNewItem(String, String) AddNewItem(String, String) AddNewItem(String, String) AddNewItem(String, String) AddNewItem(String, String) AddNewItem(String, String)

Adds a new item to the current project.

IsFileOpen(String, String) IsFileOpen(String, String) IsFileOpen(String, String) IsFileOpen(String, String) IsFileOpen(String, String) IsFileOpen(String, String)

Indicates whether or not the specified saved file is currently open in the specified view.

Navigate(String, vsNavigateOptions) Navigate(String, vsNavigateOptions) Navigate(String, vsNavigateOptions) Navigate(String, vsNavigateOptions) Navigate(String, vsNavigateOptions) Navigate(String, vsNavigateOptions)

Goes to the given URL.

NewFile(String, String, String) NewFile(String, String, String) NewFile(String, String, String) NewFile(String, String, String) NewFile(String, String, String) NewFile(String, String, String)

Creates a file as though you invoked a New File command in the integrated development environment (IDE).

OpenFile(String, String) OpenFile(String, String) OpenFile(String, String) OpenFile(String, String) OpenFile(String, String) OpenFile(String, String)

Opens a file as though you invoked an Open File command in the integrated development environment (IDE).

Applies to