コード例 #1
0
        //List all stored priorities
        public Array ListConfPrio()
        {
            if (!File.Exists("ConfigPriority.json"))
            {
                CreatFile("Prio");
            }
            int NumTask;

            SerializedData = File.ReadAllText("ConfigPriority.json");
            listPrio       = JsonConvert.DeserializeObject <ListPrio>(SerializedData);

            for (NumTask = 0; NumTask < listPrio.AllPrio.Count; NumTask++)
            {
            }

            string[] AllPrio = new string[NumTask];

            for (int i = 0; i < NumTask; i++)
            {
                AllPrio[i] = listPrio.AllPrio[i].Priority;
            }


            return(AllPrio);
        }
コード例 #2
0
 public JsonTask()
 {   //implementation of the tasks object
     _Tasks     = new Tasks();
     listExt    = new ListExt();
     listMetier = new ListMetier();
     listPrio   = new ListPrio();
 }
コード例 #3
0
 //method creating the specified file for the software configuration
 public void CreatFile(string file)
 {
     if (file == "metier")
     {
         listMetier = new ListMetier()
         {
             AllMetier = new List <ConfigMetier>()
         };
         SerializedData = JsonConvert.SerializeObject(listMetier);
         File.WriteAllText("ConfigMetier.json", SerializedData);
     }
     else if (file == "Ext")
     {
         listExt = new ListExt()
         {
             AllExt = new List <ConfigExtention>()
         };
         SerializedData = JsonConvert.SerializeObject(listExt);
         File.WriteAllText("ConfigExtention.json", SerializedData);
     }
     else if (file == "Prio")
     {
         listPrio = new ListPrio()
         {
             AllPrio = new List <ConfigPrio>()
         };
         SerializedData = JsonConvert.SerializeObject(listPrio);
         File.WriteAllText("ConfigPriority.json", SerializedData);
     }
 }