Exemple #1
0
        private static AutoInflatingTypeFactory CreateSut()
        {
            var inflatableTypeFactory = new DummyAutoInflatingTypeFactory(
                new TypeFactory(),
                new InflatableTranslator(),
                typeFactory => new XmlLoader(new DummyParserFactory(RuntimeTypeSource.FromAttributes(Assemblies.AssembliesInAppFolder))));

            return(inflatableTypeFactory);
        }
Exemple #2
0
        private static void Main()
        {
            var runtimeTypeSource = RuntimeTypeSource.FromAttributes(Assemblies.AssembliesInAppFolder);
            var loader            = new DefaultLoader(runtimeTypeSource);

            var model = (Zoo)loader.FromPath("Model.xaml", new Settings {
                InstanceLifeCycleListener = new MyListener()
            });
            var byName = model.Find("Rocky");

            Console.WriteLine("Loaded model:\n{0}", model);
            Console.WriteLine($"Searching an animal by name in this namescope (Zoo instance): \n\tRocky => {byName}");
            Console.ReadLine();
        }