public override Task LoadAll() { var property = Collection.Resolve("Server/FieldSet.img"); var id = 0; property.Children .ToDictionary( c => id++, c => FieldSetTemplate.Parse(id, c) ) .ForEach(kv => Templates.Add(kv.Key, kv.Value)); return(Task.CompletedTask); }
public static FieldSetTemplate Parse(int id, IDataProperty property) { var t = new FieldSetTemplate { ID = id }; property.Resolve(p => { t.Name = p.Name; t.Fields = p.Children .Where(c => c.Name.All(char.IsDigit)) .Select(c => c.Resolve <int>() ?? 999999999) .ToList(); }); return(t); }