// All {} and %% in the Attribute have been resolved by now. private SampleItem BuildItemFromAttr(SampleAttribute attribute) { var root = GetRoot(attribute); var path = Path.Combine(root, attribute.FileName); if (!File.Exists(path)) { return(null); } var contents = File.ReadAllText(path); return(new SampleItem { Name = attribute.FileName, Contents = contents }); }
private string GetRoot(SampleAttribute attribute) { var root = attribute.Root ?? this.Root ?? Path.GetTempPath(); return(root); }
private IAsyncCollector <SampleItem> BuildCollector(SampleAttribute attribute) { var root = GetRoot(attribute); return(new SampleAsyncCollector(root)); }