public static ActionResult InstallUtilExec(Session session) { AssemblyName me = typeof(JsonJPath).Assembly.GetName(); session.Log($"Initialized from {me.Name} v{me.Version}"); InstallUtil executer = new InstallUtil(); XmlSerializer srlz = new XmlSerializer(executer.catalogs_.GetType()); string cad = session["CustomActionData"]; if (string.IsNullOrWhiteSpace(cad)) { session.Log("Nothing to do"); return(ActionResult.Success); } using (StringReader sr = new StringReader(cad)) { if (srlz.Deserialize(sr) is IEnumerable <InstallUtilCatalog> ctlgs) { executer.catalogs_.AddRange(ctlgs); } } executer.Execute(session); return(ActionResult.Success); }
public static ActionResult InstallUtilExec(Session session) { session.Log("Begin InstallUtilExec"); InstallUtil executer = new InstallUtil(); XmlSerializer srlz = new XmlSerializer(executer.catalogs_.GetType()); string cad = session["CustomActionData"]; using (StringReader sr = new StringReader(cad)) { if (srlz.Deserialize(sr) is IEnumerable <InstallUtilCatalog> ctlgs) { executer.catalogs_.AddRange(ctlgs); } } executer.Execute(session); return(ActionResult.Success); }