public bool SaveFile() { JObject jo = new JObject(); jo["Conditions"] = actionfieldfilter.GetJSONObject(); jo["Programs"] = actionprogramlist.ToJSONObject(); jo["Enabled"] = enabled; jo["Install"] = installationvariables.ToJSONObject(); string json = jo.ToString(Formatting.Indented); try { using (StreamWriter sr = new StreamWriter(filepath)) { sr.Write(json); sr.Close(); } return(true); } catch { } return(false); }