Exemplo n.º 1
0
        public void SetUp()
        {
            LayoutParser layoutParser = new LayoutParser();

            // The IDE is supposed to run this program from [XmLift Tests directory]/bin/[Debug|Release]
            // We go back three levels to find the sample files in the root of the project
            Layout layout = layoutParser.parseXmlFile("../../../DemoFiles/SampleLayout.xml");

            parser = new ModelParser(layout);
        }
Exemplo n.º 2
0
        private List <Layout> loadLayoutsFromDir(string dir)
        {
            LayoutParser  parser = new LayoutParser();
            List <Layout> result = new List <Layout>();

            foreach (string layoutFile in Directory.EnumerateFiles(dir, "*.xml"))
            {
                Layout l = parser.parseXmlFile(layoutFile);
                result.Add(l);
            }

            return(result);
        }
Exemplo n.º 3
0
        private static void execWithPreloadedXmlAndLayout(string xmlPath, string layoutPath)
        {
            // Currently used for dev tests. TODO handle errors in a user-friendly way
            XmlModel model;

            Layout layout;

            try
            {
                LayoutParser layoutParser = new LayoutParser();
                layout = layoutParser.parseXmlFile(layoutPath);
                ModelParser parser = new ModelParser(layout);
                model = parser.parseXmlFile(xmlPath);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "|" + ex.StackTrace);
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm(model, xmlPath, layout));
        }