public async Task <M <Source> > GetSourceAsync(ModelPaths modelPaths, DataNodeName nodeName) { Log.Debug($"Get source for {nodeName} in model {modelPaths}..."); try { if (!TryGetParser(modelPaths, out IParser parser)) { return(Error.From($"File not supported: {modelPaths}")); } NodeDataSource source = await parser.GetSourceAsync(modelPaths.ModelPath, (string)nodeName); if (source == null) { return(M.NoValue); } return(new Source(source.Path, source.Text, source.LineNumber)); } catch (Exception e) { return(Error.From(e)); } }
public async Task <M <Source> > TryGetSourceAsync(ModelPaths modelPaths, DataNodeName nodeName) => await parserService.GetSourceAsync(modelPaths, nodeName);
public void Set(DataNodeName val, int data) { this.name = val; this.x = data; }
public DataNode(DataNodeName val, int data) { this.Set(val, data); }