Ejemplo n.º 1
0
        public override ExitCode Execute()
        {
            bool removed = false;

            foreach (var digest in AdditionalArgs.Select(x => new ManifestDigest(x)))
            {
                removed |= ImplementationStore.Remove(digest, Handler);
            }
            return(removed ? ExitCode.OK : ExitCode.NoChanges);
        }
Ejemplo n.º 2
0
 public override ExitCode Execute()
 {
     foreach (var digest in AdditionalArgs.Select(x => new ManifestDigest(x)))
     {
         if (!Store.Remove(digest, Handler))
         {
             throw new ImplementationNotFoundException(digest);
         }
     }
     return(ExitCode.OK);
 }
Ejemplo n.º 3
0
            /// <summary>
            /// Returns the default <see cref="IStore"/> or a <see cref="CompositeStore"/> as specifief by the <see cref="CliCommand.AdditionalArgs"/>.
            /// </summary>
            protected IStore GetEffectiveStore()
            {
                if (AdditionalArgs.Count == 0)
                {
                    return(Store);
                }
                else
                {
                    foreach (string path in AdditionalArgs)
                    {
                        if (!Directory.Exists(path))
                        {
                            throw new DirectoryNotFoundException(string.Format(Resources.FileOrDirNotFound, path));
                        }
                    }

                    return(new CompositeStore(
                               AdditionalArgs.Select(x => (IStore) new DirectoryStore(x, useWriteProtection: false))));
                }
            }