Ejemplo n.º 1
0
        /// <summary>
        /// The Checks to see if any checked entries are installed.
        /// </summary>
        /// <param name="vm">The vm<see cref="IArchiveViewModel"/>.</param>
        /// <param name="path">The path<see cref="string"/>.</param>
        /// <returns>The <see cref="bool"/>.</returns>
        public static bool AreAnyCheckedEntriesInstalled(this IArchiveViewModel vm, string path)
        {
            if (vm.SelectedDirectory is IArchiveEntryViewModel)
            {
                return((vm.SelectedDirectory as IArchiveEntryViewModel).AreAnyCheckedEntriesInstalled(path));
            }

            return(vm.SortedEntries.Values.Where(e => e.WillInstall).Any(e => e.IsInstalled(path)));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Install Checked Entries.
        /// </summary>
        /// <param name="ivm">The ivm<see cref="IArchiveViewModel"/>.</param>
        /// <param name="path">The path<see cref="string"/>.</param>
        /// <param name="overwrite">The overwrite<see cref="bool"/>.</param>
        /// <returns>The <see cref="IEnumerable{string}"/>.</returns>
        public static IEnumerable <string> InstallCheckedEntries(this IArchiveViewModel ivm, string path, bool overwrite = false)
        {
            if (ivm is ZipArchiveViewModel zvm)
            {
                return(zvm.InstallCheckedEntries(path, overwrite));
            }

            if (ivm is SevenZipArchiveViewModel svm)
            {
                return(svm.InstallCheckedEntries(path, overwrite));
            }

            throw new ArgumentException("Null or unknown view model.", nameof(ivm));
        }
Ejemplo n.º 3
0
 public ArchivesViewModel(IArchiveViewModel archive1Vm, IArchiveViewModel archive2Vm)
 {
     Archive1Vm = archive1Vm;
     Archive2Vm = archive2Vm;
 }