Exemple #1
0
 public void Load(JObject file)
 {
     JArray sheetsElem = file.Property("sheets").Value as JArray;
     for (int i = 0; i < sheetsElem.Count; ++i) {
     JObject sheet = sheetsElem[i] as JObject;
     string sheetName = sheet.Property("name").Value.ToString();
     if (sheetName.Equals("Test")) {
         JArray linesElem = sheet.Property("lines").Value as JArray;
         for (int j = 0; j < linesElem.Count; ++j) {
             Test val = new Test();
             val.Load(linesElem[j] as JObject);
             TestList.Add(val);
         }
     }
     else if (sheetName.Equals("SecondSheet")) {
         JArray linesElem = sheet.Property("lines").Value as JArray;
         for (int j = 0; j < linesElem.Count; ++j) {
             SecondSheet val = new SecondSheet();
             val.Load(linesElem[j] as JObject);
             SecondSheetList.Add(val);
         }
     }
     }
     for (int i = 0; i < TestList.Count; ++i)
     TestList[i].ResolveReferences(this);
     for (int i = 0; i < SecondSheetList.Count; ++i)
     SecondSheetList[i].ResolveReferences(this);
 }
Exemple #2
0
 public void ResolveReferences(MyDB db)
 {
     for (int i = 0; i < db.SecondSheetList.Count; ++i)
     {
         if (db.SecondSheetList[i].ID.Equals(NewRefTestKey))
         {
             NewRefTest = db.SecondSheetList[i];
             break;
         }
     }
 }
Exemple #3
0
        public void Load(JObject file)
        {
            JArray sheetsElem = file.Property("sheets").Value as JArray;

            for (int i = 0; i < sheetsElem.Count; ++i)
            {
                JObject sheet     = sheetsElem[i] as JObject;
                string  sheetName = sheet.Property("name").Value.ToString();
                if (sheetName.Equals("Test"))
                {
                    JArray linesElem = sheet.Property("lines").Value as JArray;
                    for (int j = 0; j < linesElem.Count; ++j)
                    {
                        Test val = new Test();
                        val.Load(linesElem[j] as JObject);
                        TestList.Add(val);
                    }
                }
                else if (sheetName.Equals("SecondSheet"))
                {
                    JArray linesElem = sheet.Property("lines").Value as JArray;
                    for (int j = 0; j < linesElem.Count; ++j)
                    {
                        SecondSheet val = new SecondSheet();
                        val.Load(linesElem[j] as JObject);
                        SecondSheetList.Add(val);
                    }
                }
            }
            for (int i = 0; i < TestList.Count; ++i)
            {
                TestList[i].ResolveReferences(this);
            }
            for (int i = 0; i < SecondSheetList.Count; ++i)
            {
                SecondSheetList[i].ResolveReferences(this);
            }
        }
Exemple #4
0
 public void ResolveReferences(MyDB db)
 {
     for (int i = 0; i < db.SecondSheetList.Count; ++i) {
     if (db.SecondSheetList[i].ID.Equals(NewRefTestKey)) {
         NewRefTest = db.SecondSheetList[i];
         break;
     }
     }
 }