private static IExampleGroupInfo CreateExampleGroupInfo(IControlInfo control, XElement element) { ExampleGroupInfo info = new ExampleGroupInfo(); System.Diagnostics.Debug.Assert(element != null, "Ported from old code, element purposedly should not be null."); info.Control = control; info.Name = element.GetAttribute("name", null); info.Examples = new List <IExampleInfo>(); LoadExamplesData(info, element); return(info); }
private static void LoadExamplesData(ExampleGroupInfo info, XElement element) { foreach (var item in element.Elements("Example")) { var newExample = ModelFactory.CreateExampleInfo(info, item); if (newExample.Platform != ModelFactory.PLATFORM) { // Don't load the example if not for the current platform. continue; } info.Examples.Add(newExample); } }