/// <summary> /// Initializes a new instance of the <see cref="PackageEventArgs"/> class. /// </summary> public PackageEventArgs( string eventName, Bucket bucket, IIO io, bool devMode, IPolicy policy, Pool pool, RepositoryComposite repositoryInstalled, Request request, IOperation[] operations, IOperation operation) : base(eventName, bucket, io, devMode, policy, pool, repositoryInstalled, request, operations) { this.operation = operation; }
/// <summary> /// Initializes a new instance of the <see cref="InstallerEventArgs"/> class. /// </summary> public InstallerEventArgs( string eventName, Bucket bucket, IIO io, bool devMode, IPolicy policy, Pool pool, RepositoryComposite repositoryInstalled, Request request, IOperation[] operations) : base(eventName) { IsDevMode = devMode; this.bucket = bucket; this.io = io; this.policy = policy; this.pool = pool; this.repositoryInstalled = repositoryInstalled; this.request = request; this.operations = operations; }
/// <inheritdoc /> protected override int Execute(IInput input, IOutput output) { var platformRepository = new RepositoryPlatform(); var io = GetIO(); var bucket = GetBucket(false); if (!bucket) { var factory = new Factory(); bucket = factory.CreateBucket(io, new ConfigBucket(), input.HasRawOption("--no-plugins")); } var localInstalledRepository = bucket.GetRepositoryManager().GetLocalInstalledRepository(); var repositoryInstalled = new RepositoryComposite(localInstalledRepository, platformRepository); var repositories = new RepositoryComposite(Arr.Merge(new[] { repositoryInstalled }, bucket.GetRepositoryManager().GetRepositories())); var commandEvent = new CommandEventArgs(PluginEvents.Command, "search", input, output); bucket.GetEventDispatcher().Dispatch(this, commandEvent); var flags = input.GetOption("only-name") ? SearchMode.Name : SearchMode.Fulltext; var results = repositories.Search(string.Join(Str.Space, input.GetArgument("tokens")), flags, input.GetOption("type")); var seed = new HashSet <string>(); foreach (var result in results) { if (!seed.Add(result.GetName())) { continue; } io.Write(result.ToString()); } return(ExitCodes.Normal); }
public void Initialize() { repositoryOne = new RepositoryArray(); repositoryTwo = new RepositoryArray(); repositoryComposite = new RepositoryComposite(repositoryOne, repositoryTwo); }