public GeneratorArguments(TConfig config, string atomsFolder, AtomDefaults defaults, ReadOnlyCollection <AtomModel> atoms) : this( config, atomsFolder, defaults, new Lazy <ReadOnlyCollection <AtomModel> >(() => atoms), Lazy(() => LoadProjections(atomsFolder))) { }
public GeneratorArguments(TConfig config, string atomsFolder, AtomDefaults defaults) : this( config, atomsFolder, defaults, Lazy(() => LoadAtoms(atomsFolder, defaults)), Lazy(() => LoadProjections(atomsFolder))) { }
private static ReadOnlyCollection <AtomModel> LoadAtoms(string atomsFolder, AtomDefaults defaults) { Log.Information("Loading atoms from {AtomFolder}", atomsFolder); var atoms = AtomCreator.FromFolder(atomsFolder, defaults).ToList(); Log.Information("Loaded {LoadedAtomsCount} atoms", atoms.Count); return(atoms.AsReadOnly()); }
private GeneratorArguments( TConfig config, string atomsFolder, AtomDefaults defaults, Lazy <ReadOnlyCollection <AtomModel> > atoms, Lazy <ReadOnlyCollection <ProjectionAtom> > projections) { Config = config; AtomsFolder = atomsFolder; Defaults = defaults; _atoms = atoms; }
public static ReadOnlyCollection<AtomModel> FromFolder(string path, AtomDefaults defaults = null) { var allAtoms = Directory.EnumerateFiles(path, "*.atom") .Where(i => !IsProjection(i) && !IsDefaultAtom(i)) .Select( file => { var atom = FromString(File.ReadAllText(file), defaults); return atom; }); return AtomMemberBinder.BindReferences(allAtoms).ToList().AsReadOnly(); }
public static ReadOnlyCollection <AtomModel> FromFolder(string path, AtomDefaults defaults = null) { var allAtoms = Directory.EnumerateFiles(path, "*.atom") .Where(i => !IsProjection(i) && !IsDefaultAtom(i)) .Select( file => { var atom = FromString(File.ReadAllText(file), defaults); return(atom); }); return(AtomMemberBinder.BindReferences(allAtoms).ToList().AsReadOnly()); }
internal static AtomModel FromString(string atomString, AtomDefaults defaults = null) { return JsonConvert.DeserializeObject<AtomModel>(atomString, new AtomRootConverter(defaults?.AdditionalInfo ?? AtomAdditionalInfo.Default())); }
internal static AtomModel FromString(string atomString, AtomDefaults defaults = null) { return(JsonConvert.DeserializeObject <AtomModel>(atomString, new AtomRootConverter(defaults?.AdditionalInfo ?? AtomAdditionalInfo.Default()))); }