/// <summary> /// Verifica se a entrada é válida. /// </summary> /// <param name="assemblyRepository"></param> /// <returns></returns> public bool IsValid(AssemblyRepository assemblyRepository) { var assembliesDirectories = assemblyRepository._assemblyFilesDirectories.Where(f => !string.IsNullOrEmpty(f) && System.IO.Directory.Exists(f)).ToList(); if (!string.IsNullOrEmpty(_fileName) && assembliesDirectories.Count > 0) { var fileInfo = new System.IO.FileInfo(_fileName); if (!fileInfo.Exists) { return(false); } foreach (var i in Parts.Select(f => f.Source)) { foreach (var directory in assembliesDirectories) { var partFileInfo = new System.IO.FileInfo(System.IO.Path.Combine(directory, i)); if (partFileInfo.Exists) { return(partFileInfo.LastWriteTime == fileInfo.LastWriteTime); } } } } else if (Package != null) { return(true); } return(false); }
/// <summary> /// Construtor padrão. /// </summary> /// <param name="owner"></param> /// <param name="packages"></param> /// <param name="ar"></param> public DownloaderState(AssemblyRepository owner, IEnumerable <IAssemblyPackage> packages, Threading.AsyncResult <AssemblyPackageContainer> ar) { this.Owner = owner; this.Packages = packages; this.AsyncResult = ar; }