protected virtual PathElementDTO CreatePathElementDTO(IContainer container) { string iconName = null; if (ApplicationIcons.HasIconNamed(container.Icon)) { iconName = container.Icon; } return(CreatePathElementDTO(DisplayNameFor(container), iconName)); }
private void updateMoleculeIcon(PathElements pathElements) { if (!pathElements.Contains(PathElementId.Molecule)) return; var moleculePathElement = pathElements[PathElementId.Molecule]; if (ApplicationIcons.HasIconNamed(moleculePathElement.IconName)) return; moleculePathElement.IconName = ApplicationIcons.Drug.IconName; }
public void Visit(IBuildingBlock buildingBlock) { if (string.IsNullOrEmpty(buildingBlock.Icon)) { return; } if (ApplicationIcons.HasIconNamed(buildingBlock.Icon)) { return; } buildingBlock.Icon = buildingBlock.Icon.Replace(" ", ""); _converted = true; }
protected virtual PathElementDTO CreatePathElementDTO(string pathElementValue, string iconName = null) { var iconNameToUse = string.IsNullOrEmpty(iconName) ? pathElementValue.Replace(" ", string.Empty) : iconName; if (!ApplicationIcons.HasIconNamed(iconNameToUse)) { iconNameToUse = null; } return(new PathElementDTO { DisplayName = pathElementValue, IconName = iconNameToUse }); }
private ApplicationIcon getIconByTypeName(object objectBase) { var typeName = objectBase.GetType().Name; if (ApplicationIcons.HasIconNamed(typeName)) { return(ApplicationIcons.IconByName(typeName)); } if (typeName.StartsWith("I")) { typeName = typeName.Substring(1); } if (!ApplicationIcons.HasIconNamed(typeName)) { typeName = typeName.Remove(typeName.Length - "Builder".Length); } return(ApplicationIcons.IconByName(typeName)); }
private ApplicationIcon iconByName(string iconName) { return(ApplicationIcons.HasIconNamed(iconName) ? ApplicationIcons.IconByName(iconName) : null); }