C# Class Umbraco.UmbracoStudio.VisualStudio.ProjectCache

Cache that stores project based on multiple names. i.e. Project can be retrieved by name (if non conflicting), unique name and custom unique name.
Mostrar archivo Open project: umbraco/Visual-Studio-Extension Class Usage Examples

Public Methods

Method Description
AddProject ( Project project ) : ProjectName

Add a project to the cache.

Contains ( string name ) : bool
GetProjects ( ) : IEnumerable

Returns all cached projects.

IsAmbiguous ( string shortName ) : bool

Determines if a short name is ambiguous

RemoveProject ( string name ) : void

Removes a project and returns the project name instance of the removed project.

TryGetProject ( string name, Project &project ) : bool

Finds a project by short name, unique name or custom unique name.

TryGetProjectName ( string name, ProjectName &projectName ) : bool

Finds a project name by short name, unique name or custom unique name.

TryGetProjectNameByShortName ( string name, ProjectName &projectName ) : bool

Tries to find a project by short name. Returns the project name if and only if it is non-ambiguous.

Private Methods

Method Description
AddShortName ( ProjectName projectName ) : void

Adds an entry to the short name cache returning any conflicting project name.

RemoveProjectName ( ProjectName projectName ) : void

Removes a project from the project name dictionary.

RemoveShortName ( ProjectName projectName ) : void

Removes a project from the short name cache.

Method Details

AddProject() public method

Add a project to the cache.
public AddProject ( Project project ) : ProjectName
project Project project to add to the cache.
return ProjectName

Contains() public method

public Contains ( string name ) : bool
name string
return bool

GetProjects() public method

Returns all cached projects.
public GetProjects ( ) : IEnumerable
return IEnumerable

IsAmbiguous() public method

Determines if a short name is ambiguous
public IsAmbiguous ( string shortName ) : bool
shortName string short name of the project
return bool

RemoveProject() public method

Removes a project and returns the project name instance of the removed project.
public RemoveProject ( string name ) : void
name string name of the project to remove.
return void

TryGetProject() public method

Finds a project by short name, unique name or custom unique name.
public TryGetProject ( string name, Project &project ) : bool
name string name of the project to retrieve.
project Project project instance
return bool

TryGetProjectName() public method

Finds a project name by short name, unique name or custom unique name.
public TryGetProjectName ( string name, ProjectName &projectName ) : bool
name string name of the project
projectName ProjectName project name instance
return bool

TryGetProjectNameByShortName() public method

Tries to find a project by short name. Returns the project name if and only if it is non-ambiguous.
public TryGetProjectNameByShortName ( string name, ProjectName &projectName ) : bool
name string
projectName ProjectName
return bool