public static string Convert(string input) { var replayPlayer = new ReplayPlayer(input); Body rootBody = replayPlayer.RootBody; existing = new Dictionary<int, List<object>>(); result = new List<object>(); result.Add(replayPlayer.DT); rootBody.ChildAdded += BodyAdded; while (!replayPlayer.IsAtEnd) { iter = new List<string>(); replayPlayer.Update(); result.Add(iter); } return (new JavaScriptSerializer()).Serialize(result); }
public static string Convert(string input) { var replayPlayer = new ReplayPlayer(input); Body rootBody = replayPlayer.RootBody; existing = new Dictionary <int, List <object> >(); result = new List <object>(); result.Add(replayPlayer.DT); rootBody.ChildAdded += BodyAdded; while (!replayPlayer.IsAtEnd) { iter = new List <string>(); replayPlayer.Update(); result.Add(iter); } return((new JavaScriptSerializer()).Serialize(result)); }
public static string Convert(SerializationRoot input) { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); var replayPlayer = new ReplayPlayer(input); Body rootBody = replayPlayer.RootBody; existing = new Dictionary<int, List<object>>(); result = new List<object>(); result.Add(replayPlayer.DT); rootBody.ChildAdded += BodyAdded; while (!replayPlayer.IsAtEnd) { iter = new List<string>(); replayPlayer.Update(); result.Add(iter); } var res = (new JavaScriptSerializer()).Serialize(result); //replace id of root body to 0 res = res.Replace(","+rootBody.Id+",", ",0,"); return res; }
public static string Convert(SerializationRoot input) { System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US"); var replayPlayer = new ReplayPlayer(input); Body rootBody = replayPlayer.RootBody; existing = new Dictionary <int, List <object> >(); result = new List <object>(); result.Add(replayPlayer.DT); rootBody.ChildAdded += BodyAdded; while (!replayPlayer.IsAtEnd) { iter = new List <string>(); replayPlayer.Update(); result.Add(iter); } var res = (new JavaScriptSerializer()).Serialize(result); //replace id of root body to 0 res = res.Replace("," + rootBody.Id + ",", ",0,"); return(res); }