in code/tools/TemplateValidator/TemplateFolderVerifier.cs [310:352]
private static void CheckIconXamlFiles(IEnumerable<string> templateFolders, List<string> results)
{
var iconFiles = new List<string>();
foreach (var rootFolder in templateFolders)
{
iconFiles.AddRange(new DirectoryInfo(rootFolder)
.GetFiles("icon.xaml", SearchOption.AllDirectories)
.Select(file => file.FullName));
}
foreach (var iconFile in iconFiles)
{
var doc = new XmlDocument();
doc.Load(iconFile);
var ellipses = doc.GetElementsByTagName("Ellipse");
foreach (XmlNode ellipse in ellipses)
{
if (ellipse.Attributes != null && ellipse.Attributes.Count > 1
&& ellipse.Attributes["Fill"] != null && ellipse.Attributes["Stroke"] != null)
{
results.Add(
$"'{iconFile}' contains an Ellipse with both Fill and Stroke specified when use of only one is supported.");
break;
}
}
var rectangles = doc.GetElementsByTagName("Rectangle");
foreach (XmlNode rectangle in rectangles)
{
if (rectangle.Attributes != null && rectangle.Attributes.Count > 1
&& rectangle.Attributes["Fill"] != null && rectangle.Attributes["Stroke"] != null)
{
results.Add(
$"'{iconFile}' contains a Rectangle with both Fill and Stroke specified when use of only one is supported.");
break;
}
}
}
}