ChocoPM.Services.LocalChocolateyService.IsInstalled C# (CSharp) Method

IsInstalled() public method

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.
return bool
        public bool IsInstalled(string id, string version)
        {
            if (_cache.Contains(LocalCacheKeyName))
            {
                return ((List<V2FeedPackage>)this._cache.Get(LocalCacheKeyName))
                    .Any(package => package.Id == id && package.Version == version);
            }
            return false;
        }