protected override void VisitComponent(BcsComponentNode bcsComponent) { var item = new MenuItem() { Title = $"Component: {bcsComponent.Name}::{bcsComponent?.Location?.Name ?? string.Empty}" }; AddToTree(bcsComponent, item); }
protected override void VisitComponent(BcsComponentNode bcsComponent) { ResolveFromParent(bcsComponent); }
private void CreateComponents() { var components = DefinitionFile.Entities.Where(e => e.States.SourceText.IsEmptyOrWhitespace() && !e.Composition.SourceText.Contains(".")); foreach (var component in components) { var componentNode = new BcsComponentNode() { Name = component.Id }; if (!component.Composition.SourceText.IsEmptyOrWhitespace()) { var componentAgents = component.Composition.SourceText.Split('|').Select(name => { name = name.Trim(); var matchingAgent = DefinitionFile.AtomicAgents.SingleOrDefault(agent => agent.Name == name); if (matchingAgent == null) { componentNode.Errors.Add(new NodeError($"Failed to find matching agent named {name} in the definition file.")); var dummyAgent = new BcsAtomicAgentNode() { Name = name }; DefinitionFile.AtomicAgents.Add(dummyAgent); return dummyAgent; } return matchingAgent; }).ToList(); componentNode.AtomicAgents.AddRange(componentAgents); } DefinitionFile.Components.Add(componentNode); } }
protected abstract void VisitComponent(BcsComponentNode bcsComponent);
public void CreateComplexes() { var complexes = DefinitionFile.Entities.Where(e => e.States.SourceText.IsEmptyOrWhitespace() && e.Composition.SourceText.Contains(".")); foreach (var complex in complexes) { var complexNode = new BcsComplexNode() { Name = complex.Name }; var compoennts = complex.Composition.SourceText.Split('.').Select(name => { name = name.Trim(); var matchingComponent = DefinitionFile.Components.SingleOrDefault(component => component.Name == name); if (matchingComponent == null) { complexNode.Errors.Add(new NodeError($"Failed to find matching component named {name} in the definition file.")); var dummyComponent = new BcsComponentNode() { Name = name }; DefinitionFile.Components.Add(dummyComponent); return dummyComponent; } return matchingComponent; }).ToList(); complexNode.Components.AddRange(compoennts); DefinitionFile.Complexes.Add(complexNode); } }