コード例 #1
0
ファイル: IntegratedTest.cs プロジェクト: gomesrod/XmLift
        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);
        }
コード例 #2
0
ファイル: LayoutManager.cs プロジェクト: gomesrod/XmLift
        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);
        }
コード例 #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));
        }