Exemple #1
0
        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);
        }
Exemple #2
0
        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);
            }
        }