GetFilesCurrentProfiles() public method

public GetFilesCurrentProfiles ( ) : IEnumerable
return IEnumerable
示例#1
0
 private IEnumerable<Package> getPackages(bool all)
 {
     var profiles = new ProfileLocator(_token);
     var packages = new List<Package>();
     profiles.GetFilesCurrentProfiles("package.json").ToList()
         .ForEach(x => {
                 try {
                     Logger.Write("Reading package " + x);
                     var package = Package.Read(x);
                     if (package != null)
                         packages.Add(package);
                 } catch {
                 }
             });
     return packages;
 }
示例#2
0
 private Package getPackage(string name)
 {
     Logger.Write("Looking for package " + name);
     var profiles = new ProfileLocator(_token);
     var packages = new List<Package>();
     profiles.GetFilesCurrentProfiles("package.json").ToList()
         .ForEach(x => {
                 try {
                     Logger.Write("Reading package " + x);
                     var package = Package.Read(x);
                     if (package != null) {
                         Logger.Write("adding package {0} ({1})", package.ID, package.Version);
                         packages.Add(package);
                     }
                 } catch (Exception ex) {
                     Logger.Write(ex);
                 }
             });
     return packages.FirstOrDefault(x => x.ID == name);
 }