C# 클래스 ChocoPM.Services.LocalChocolateyService

상속: ObservableBase, ILocalChocolateyService
파일 보기 프로젝트 열기: RichiCoder1/ChocoPM

Private Properties

프로퍼티 타입 설명
RefreshPackages void
WriteError void
WriteOutput void

공개 메소드들

메소드 설명
ExecutePackageCommand ( string commandString, bool refreshPackages = true ) : Task

Executes a PowerShell command and returns whether or not there was a result. Optionally calls RefreshPackages.

GetPackages ( bool logOutput = false ) : Task>

Retrives all the local packages.

InstallPackageAsync ( string id, string version = null ) : Task

Install the specific package. Optionally installs a specific version of the package.

IsInstalled ( string id, string version ) : bool

Checks wether the specified package is installed.

This method will only return true if: A) We've already retrieved the local packages and cached them. B) The package is found in the cache. This is to ensure that we're not pulling the local package list until the App specifically request it.

LocalChocolateyService ( IRemoteChocolateyService remoteService ) : System.Collections.ObjectModel
RunPackageCommand ( string commandString, bool refreshPackages = true, bool logOutput = true, bool clearBuffer = true ) : Task>

Executes a PowerShell Command.

UninstallPackageAsync ( string id, string version ) : Task

Uninstall the specified package.

UpdatePackageAsync ( string id ) : Task

Updates the installed package.

Chocolatey does not currently support updating an installed package to a specific version. There's a way to do this (basically uninstall and install specific version), but it's complex and error prone enough that we're avoiding it for now.

비공개 메소드들

메소드 설명
RefreshPackages ( bool logOutput = false ) : void

Invalidates and refreshes the cache.

WriteError ( string message ) : void

Helper function to write error messages to the faux PowerShell console.

WriteOutput ( string message ) : void

Helper function to write output messages to the faux PowerShell console.

메소드 상세

ExecutePackageCommand() 공개 메소드

Executes a PowerShell command and returns whether or not there was a result. Optionally calls RefreshPackages.
public ExecutePackageCommand ( string commandString, bool refreshPackages = true ) : Task
commandString string The PowerShell command string.
refreshPackages bool Whether to call .
리턴 Task

GetPackages() 공개 메소드

Retrives all the local packages.
public GetPackages ( bool logOutput = false ) : Task>
logOutput bool If true, writes messages out to the faux PowerShell console.
리턴 Task>

InstallPackageAsync() 공개 메소드

Install the specific package. Optionally installs a specific version of the package.
public InstallPackageAsync ( string id, string version = null ) : Task
id string The Id of the package to be isntalled.
version string The specific Version string of the package to be installed.
리턴 Task

IsInstalled() 공개 메소드

Checks wether the specified package is installed.
This method will only return true if: A) We've already retrieved the local packages and cached them. B) The package is found in the cache. This is to ensure that we're not pulling the local package list until the App specifically request it.
public IsInstalled ( string id, string version ) : bool
id string The Id of the package.
version string The Version string of the package.
리턴 bool

LocalChocolateyService() 공개 메소드

public LocalChocolateyService ( IRemoteChocolateyService remoteService ) : System.Collections.ObjectModel
remoteService IRemoteChocolateyService
리턴 System.Collections.ObjectModel

RunPackageCommand() 공개 메소드

Executes a PowerShell Command.
public RunPackageCommand ( string commandString, bool refreshPackages = true, bool logOutput = true, bool clearBuffer = true ) : Task>
commandString string The PowerShell command string.
refreshPackages bool Whether to call .
logOutput bool Whether the output should be logged to the faux PowerShell console or returned as results.
clearBuffer bool Whether the faux PowerShell console should be cleared.
리턴 Task>

UninstallPackageAsync() 공개 메소드

Uninstall the specified package.
public UninstallPackageAsync ( string id, string version ) : Task
id string The Id of the package to be removed.
version string The Version string of the package to be removed.
리턴 Task

UpdatePackageAsync() 공개 메소드

Updates the installed package.
Chocolatey does not currently support updating an installed package to a specific version. There's a way to do this (basically uninstall and install specific version), but it's complex and error prone enough that we're avoiding it for now.
public UpdatePackageAsync ( string id ) : Task
id string The Id of the package.
리턴 Task