private static void ExportStruct(ProtoStructData data)
    {
        string path = string.Format(TsPathOut.OobHandler, data.funName);

        if (File.Exists(path))
        {
            return;
        }


        TemplateSystem template = new TemplateSystem(tplContent);

        template.AddVariable("funName", data.funName);
        template.AddVariable("fullClassName", data.fullClassName);
        string content = template.Parse();

        PathHelper.CheckPath(path);
        File.WriteAllText(path, content);
    }
Beispiel #2
0
    private void Read(string path)
    {
        Console.WriteLine(path);
        string   jsonTxt  = File.ReadAllText(path);
        JsonData jsonData = JsonMapper.ToObject(jsonTxt);

        foreach (var key in jsonData.Keys)
        {
            ProtoStructData oob = new ProtoStructData();
            oob.name = key;
            this.structs.Add(oob.name, oob);


            JsonData jStruct = jsonData[key];
            foreach (var mKey in jStruct.Keys)
            {
                string fieldName = mKey.ToString();
                oob.Add(fieldName, jStruct[fieldName].ToString());
            }
        }


        ReadNote(jsonTxt);
    }