public ModulePackage[] GetPackages() { var packs = new ModulePackage[packages.Count]; packages.Values.CopyTo(packs, 0); return(packs); }
public ModulePackage GetOrCreateSubPackage(string package, bool create = false) { if (string.IsNullOrEmpty(package)) { return(this); } var currentPackage = this; foreach (var p in ModuleNameHelper.SplitModuleName(package)) { ModulePackage returnValue = null; if (!currentPackage.Packages.TryGetValue(p, out returnValue)) { if (create) { returnValue = currentPackage.Packages[p] = new ModulePackage { Name = p, Parent = currentPackage } } ; else { return(null); } } currentPackage = returnValue; } return(currentPackage); }
internal static ModulePackage GetOrCreatePackage(ModulePackage root, string package, bool create = false) { return(root.GetOrCreateSubPackage(package, create)); }
internal ModulePackage(ModulePackage parent, string name) { this.Parent = parent; Strings.Add(name); NameHash = name.GetHashCode(); }