Exemple #1
0
 public void load_config(serialize_objects obj, int index)
 {
     button_done.Visibility   = Visibility.Hidden;
     button_modify.Visibility = Visibility.Visible;
     textBox_name.Text        = obj.config_name;
     textBox_trigger.Text     = obj.trigger_process;
     textBox_start.Text       = obj.bind_process;
     textBox_args.Text        = obj.args;
     set_restart_radio_button(obj.restarter);
     config_index = index;
 }
Exemple #2
0
        public serialize_objects serialize()
        {
            var sobj = new serialize_objects();

            sobj.is_enable       = is_enable.Value;
            sobj.config_name     = config_name.Value;
            sobj.status          = status.Value;
            sobj.trigger_process = trigger_name;
            sobj.bind_process    = binding_process.StartInfo.FileName;
            sobj.args            = binding_process.StartInfo.Arguments;
            sobj.start_delay     = start_delay;
            sobj.restarter       = restarter;
            return(sobj);
        }
Exemple #3
0
 private void save_configs()
 {
     serialize_objects[] objs = new serialize_objects[configs.Count];
     for (int i = 0; i < objs.Length; i++)
     {
         objs[i] = configs[i].serialize();
     }
     byte[] bytes = MessagePackSerializer.Serialize(objs);
     try
     {
         File.WriteAllBytes("./config", bytes);
     }
     catch (Exception)
     {
     }
 }
Exemple #4
0
        private void save_configs()
        {
            serialize_objects[] objs = new serialize_objects[configs.Count];
            for (int i = 0; i < objs.Length; i++)
            {
                objs[i] = configs[i].serialize();
            }
            var json = JsonConvert.SerializeObject(objs, Formatting.Indented);

            try
            {
                File.WriteAllText("./config.json", json);
            }
            catch (Exception)
            {
            }
        }
Exemple #5
0
 public void load_config(serialize_objects obj)
 {
     setup(obj.config_name, obj.trigger_process, obj.bind_process, obj.args, (obj.start_delay / 1000).ToString(), obj.restarter);
     is_enable.Value = true;
 }