Beispiel #1
0
 public void RequestEntity(string uid)
 {
     if (isLocal)
     {
         var path = Path.Combine(rootPath, "entity/entity_" + uid + ".json");
         if (!File.Exists(path))
         {
             ZLog.Warning("the file not exist that path = " + path);
             return;
         }
         var txt  = File.ReadAllText(path);
         var info = ParseUtil.ParseEntityJson(txt, rootPath);
         DFNotifyManager.SendNotify(DFNotifyType.OnEntityDataUpdate, info);
     }
     else
     {
         string           address = GetAddress(HttpAPIType.Entity);
         LitJson.JsonData json    = new LitJson.JsonData
         {
             ["uid"]  = uid,
             ["code"] = codes
         };
         ZHttpController.Post(URL_Entity, address, json.ToString(), HttpCompleteHandler, true);
     }
 }
Beispiel #2
0
 public void RequestGraph(string uid, string parent)
 {
     if (isLocal)
     {
         var path = Path.Combine(rootPath, "graph/graph_" + uid + ".json");
         if (!File.Exists(path))
         {
             ZLog.Warning("the file not exist that path = " + path);
             DFNotifyManager.SendNotify(DFNotifyType.OnGraphDataUpdate, null);
             return;
         }
         var txt   = File.ReadAllText(path);
         var graph = ParseUtil.ParseGraphJson(txt, rootPath);
         if (graph == null)
         {
             ZLog.Warning("the graph data is null");
             DFNotifyManager.SendNotify(DFNotifyType.OnGraphDataUpdate, null);
             return;
         }
         graph.Parent = parent;
         DFNotifyManager.SendNotify(DFNotifyType.OnGraphDataUpdate, graph);
     }
     else
     {
         string address = GetAddress(HttpAPIType.Graph);
         var    json    = new LitJson.JsonData
         {
             ["uid"]    = uid,
             ["parent"] = parent,
             ["code"]   = codes
         };
         ZHttpController.Post(URL_Graph, address, json.ToString(), HttpCompleteHandler, true);
     }
 }
Beispiel #3
0
 public void RequestGraphByTheme(string uid)
 {
     if (isLocal)
     {
         return;
     }
     else
     {
         string           address = GetAddress(HttpAPIType.Graph);
         LitJson.JsonData json    = new LitJson.JsonData
         {
             ["theme"] = uid,
             ["code"]  = codes
         };
         ZHttpController.Post(URL_Graph, address, json.ToString(), HttpCompleteHandler, true);
     }
 }
Beispiel #4
0
 public void RequestThemes()
 {
     if (isLocal)
     {
         var path = Path.Combine(rootPath, "themes.json");
         if (!File.Exists(path))
         {
             ZLog.Warning("the file not exist that path = " + path);
             return;
         }
         var txt  = File.ReadAllText(path);
         var list = ParseUtil.ParseThemes(txt, rootPath);
         DFNotifyManager.SendNotify(DFNotifyType.OnThemesUpdate, list);
     }
     else
     {
         string address = GetAddress(HttpAPIType.Themes);
         var    json    = new LitJson.JsonData
         {
             ["code"] = codes
         };
         ZHttpController.Post(URL_Themes, address, json.ToString(), HttpCompleteHandler, true);
     }
 }