C# Class Microsoft.VsSDK.IntegrationTestLibrary.TestUtils

Mostrar archivo Open project: ChaosinaCan/BraceCompleter Class Usage Examples

Public Methods

Method Description
AddNewItemFromVsTemplate ( ProjectItems parent, string templateName, string language, string name ) : ProjectItem

Create a new item in the project

CanFindToolwindow ( System.Guid persistenceGuid ) : bool
CloseCurrentSolution ( __VSSLNSAVEOPTIONS saveoptions ) : void
CloseInEditorWithoutSaving ( string fullFileName ) : void
CreateEmptySolution ( string directory, string solutionName ) : void

Closes the currently open solution (if any), and creates a new solution with the given name.

CreateProjectFromTemplate ( string projectName, string templateName, string language, bool exclusive ) : void

Creates a project.

ExecuteCommand ( CommandID cmd ) : void

Executes a Command (menu item) in the given context

ForceSaveSolution ( ) : void
GetEmbeddedStringResource ( Assembly assembly, string resourceName ) : string

Gets the embedded file identified by the resource name, and converts the file into a string.

GetNewDirectoryName ( string directory, string baseDirectoryName ) : string

Returns the first available directory name on the form [baseDirectoryName]i where [i] starts at 1 and increases until there is an available directory name in the given directory. Also creates the directory to mark it as occupied.

GetNewFileName ( string directory, string baseFileName, string extension ) : string

Returns the first available file name on the form [baseFileName]i.[extension] where [i] starts at 1 and increases until there is an available file name in the given directory. Also creates an empty file with that name to mark that file as occupied.

LoadPackage ( System.Guid packageGuid ) : IVsPackage
ProjectCount ( ) : int

Get current number of open project in solution

SaveDocument ( string documentMoniker ) : void

Save an open document.

WriteEmbeddedResourceToBinaryFile ( Assembly assembly, string embeddedResourceName, string fileName ) : void

Writes an embedded resource to a file.

WriteEmbeddedResourceToFile ( Assembly assembly, string embeddedResourceName, string fileName ) : void

Private Methods

Method Description
GetNewFileOrDirectoryNameWithoutCreatingAnything ( string directory, string baseFileName, string extension ) : string

Method Details

AddNewItemFromVsTemplate() public method

Create a new item in the project
public AddNewItemFromVsTemplate ( ProjectItems parent, string templateName, string language, string name ) : ProjectItem
parent ProjectItems the parent collection for the new item
templateName string
language string
name string
return ProjectItem

CanFindToolwindow() public method

public CanFindToolwindow ( System.Guid persistenceGuid ) : bool
persistenceGuid System.Guid
return bool

CloseCurrentSolution() public method

public CloseCurrentSolution ( __VSSLNSAVEOPTIONS saveoptions ) : void
saveoptions __VSSLNSAVEOPTIONS
return void

CloseInEditorWithoutSaving() public method

public CloseInEditorWithoutSaving ( string fullFileName ) : void
fullFileName string
return void

CreateEmptySolution() public method

Closes the currently open solution (if any), and creates a new solution with the given name.
public CreateEmptySolution ( string directory, string solutionName ) : void
directory string
solutionName string Name of new solution.
return void

CreateProjectFromTemplate() public method

Creates a project.
public CreateProjectFromTemplate ( string projectName, string templateName, string language, bool exclusive ) : void
projectName string Name of new project.
templateName string Name of project template to use
language string language
exclusive bool
return void

ExecuteCommand() public method

Executes a Command (menu item) in the given context
public ExecuteCommand ( CommandID cmd ) : void
cmd System.ComponentModel.Design.CommandID
return void

ForceSaveSolution() public method

public ForceSaveSolution ( ) : void
return void

GetEmbeddedStringResource() public static method

Gets the embedded file identified by the resource name, and converts the file into a string.
public static GetEmbeddedStringResource ( Assembly assembly, string resourceName ) : string
assembly System.Reflection.Assembly
resourceName string In VS, is DefaultNamespace.FileName?
return string

GetNewDirectoryName() public static method

Returns the first available directory name on the form [baseDirectoryName]i where [i] starts at 1 and increases until there is an available directory name in the given directory. Also creates the directory to mark it as occupied.
public static GetNewDirectoryName ( string directory, string baseDirectoryName ) : string
directory string Directory that the file should live in.
baseDirectoryName string
return string

GetNewFileName() public static method

Returns the first available file name on the form [baseFileName]i.[extension] where [i] starts at 1 and increases until there is an available file name in the given directory. Also creates an empty file with that name to mark that file as occupied.
public static GetNewFileName ( string directory, string baseFileName, string extension ) : string
directory string Directory that the file should live in.
baseFileName string
extension string may be null, in which case the .[extension] part /// is not added.
return string

LoadPackage() public method

public LoadPackage ( System.Guid packageGuid ) : IVsPackage
packageGuid System.Guid
return IVsPackage

ProjectCount() public method

Get current number of open project in solution
public ProjectCount ( ) : int
return int

SaveDocument() public method

Save an open document.
public SaveDocument ( string documentMoniker ) : void
documentMoniker string for filebased documents this is the full path to the document
return void

WriteEmbeddedResourceToBinaryFile() public static method

Writes an embedded resource to a file.
public static WriteEmbeddedResourceToBinaryFile ( Assembly assembly, string embeddedResourceName, string fileName ) : void
assembly System.Reflection.Assembly The name of the assembly that the embedded resource is defined.
embeddedResourceName string The name of the embedded resource.
fileName string The file to write the embedded resource's content.
return void

WriteEmbeddedResourceToFile() public static method

public static WriteEmbeddedResourceToFile ( Assembly assembly, string embeddedResourceName, string fileName ) : void
assembly System.Reflection.Assembly
embeddedResourceName string
fileName string
return void