Exemplo n.º 1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List <Models.Config_m> list = new List <Models.Config_m>();

            foreach (string key in ConfigurationManager.AppSettings)
            {
                Models.Config_m m = new Models.Config_m();
                m.key   = key;
                m.value = ConfigurationManager.AppSettings[key];
                list.Add(m);
            }
            //this.DataContext = list;
            dataGrid.ItemsSource = list;
            dataGrid.IsReadOnly  = false;
        }
Exemplo n.º 2
0
        private void button_Click(object sender, RoutedEventArgs e)
        {
            List <Models.Config_m> list = dataGrid.ItemsSource as List <Models.Config_m>;

            configbll.SaveConfigSuper(list);


            BLL.LogBll   logbll = new BLL.LogBll();
            Models.Log_m log    = new Models.Log_m("更改设置", "Y", "");


            list.Clear();
            foreach (string key in ConfigurationManager.AppSettings)
            {
                Models.Config_m m = new Models.Config_m();
                m.key   = key;
                m.value = ConfigurationManager.AppSettings[key];
                list.Add(m);
                log.node += "[" + m.key + "," + m.value + "]";
            }
            logbll.AddLog(log, ConfigurationManager.AppSettings["logFile"]);
            dataGrid.ItemsSource = list;
        }