Beispiel #1
0
        private void button9_Click(object sender, EventArgs e)
        {
            GenConfig config = new GenConfig();

            string[] apps = config.GetApps();
            if (apps != null && apps.Length > 0)
            {
                for (int i = 0; i < apps.Length; i++)
                {
                    config.Save(trvControllers, "App");
                }
            }
        }
Beispiel #2
0
        public frmMain()
        {
            InitializeComponent();
            LoadControllers();
            GenConfig config = new GenConfig();

            string[] apps = config.GetApps();
            if (apps != null && apps.Length > 0)
            {
                for (int i = 0; i < apps.Length; i++)
                {
                    config.Load(trvControllers, "App");
                }
            }
        }
Beispiel #3
0
        public void Load(TreeView tv, string app)
        {
            FilePath fp = new FilePath();

            if (!File.Exists(fp.MapPath(app + "/compile.xml")))
            {
                return;
            }

            XmlSerializer ser    = new XmlSerializer(typeof(GenConfig));
            StreamReader  sr     = new StreamReader(fp.MapPath(app + "/compile.xml"), System.Text.Encoding.UTF8);
            GenConfig     config = (GenConfig)ser.Deserialize(sr);

            sr.Close();
            if (config.controllerFiles.Count > 0)
            {
                TreeNode[] tns;
                for (int i = 0; i < config.controllerFiles.Count; i++)
                {
                    tns = tv.Nodes.Find(fp.MapPath(config.controllerFiles[i]), true);
                    if (tns != null && tns.Length > 0)
                    {
                        tns[0].Checked = true;
                    }
                }
            }
            if (config.bllFiles.Count > 0)
            {
                TreeNode[] tns;
                for (int i = 0; i < config.bllFiles.Count; i++)
                {
                    tns = tv.Nodes.Find(fp.MapPath(config.bllFiles[i]), true);
                    if (tns != null && tns.Length > 0)
                    {
                        tns[0].Checked = true;
                    }
                }
            }
        }