private void addCommonModelReplacersTo(IKeywordReplacerCollection keywordReplacer, IContainer rootContainer) { //Replace the predefined keywords keywordReplacer.AddReplacement(new TopContainerPathReplacer(rootContainer.Name, rootContainer.GetChildren <IContainer>().AllNames())); keywordReplacer.AddReplacement( new TopContainerPathReplacer(rootContainer.Name, new[] { ObjectPathKeywords.MOLECULE, Constants.NEIGHBORHOODS })); }
private void addCommonNeighborhoodReplacersTo(IKeywordReplacerCollection keywordReplacer, INeighborhood neighborhood) { if (neighborhood == null) { return; } keywordReplacer.AddReplacement(new KeywordWithPathReplacer(ObjectPathKeywords.FIRST_NEIGHBOR, _objectPathFactory.CreateAbsoluteObjectPath(neighborhood.FirstNeighbor))); keywordReplacer.AddReplacement(new KeywordWithPathReplacer(ObjectPathKeywords.SECOND_NEIGHBOR, _objectPathFactory.CreateAbsoluteObjectPath(neighborhood.SecondNeighbor))); keywordReplacer.AddReplacement(new KeywordWithPathReplacer(ObjectPathKeywords.NEIGHBORHOOD, _objectPathFactory.CreateAbsoluteObjectPath(neighborhood))); //should be placed after the KeywordWithPathReplacer so that NEIGHBORHOOD is only replaced if not found yet keywordReplacer.AddReplacement(new SimpleKeywordReplacer(ObjectPathKeywords.NEIGHBORHOOD, neighborhood.Name)); }
private void addMoleculeReplacersTo(IKeywordReplacerCollection keywordReplacer, string moleculeName) { if (string.IsNullOrEmpty(moleculeName)) { return; } keywordReplacer.AddReplacement(new SimpleKeywordReplacer(ObjectPathKeywords.MOLECULE, moleculeName)); }