public void Save(SavedSessions savedSessions)
 {
     var savedSessionPath = GetSavedSessionPath(savedSessions.Name);
     var serializer =  new XmlSerializer(typeof(SavedSessions));
     using (var textWriter = new StreamWriter(savedSessionPath))
     {
         serializer.Serialize(textWriter, savedSessions);
     }
 }
        public JsonResult Save()
        {
            var precompilers = Request.Form["precompiler"];
            var sessions = Request.Form["session"];
            var savedSessions = new SavedSessions();

            if (precompilers != null || sessions != null)
            {
                savedSessions.Precompilers = precompilers;
                savedSessions.Sessions = sessions;
            }

            new SavedSessionsRepository(Server).Save(savedSessions);
            var result = new JsonResult { Data = savedSessions.Name };
            return result;
        }