void getData() { if (instance == null) { instance = new ConfigFile(); } instance.DeployFullLocation = txtLocation.Text; instance.Content = rtbContent.Text; instance.Remarks = rtbRemarks.Text; }
public static void UpdateConfigFile(ConfigFile file) { if (Data.ConfigFiles == null || Data.ConfigFiles.Count == 0) { CreateConfigFile(file); return; } var old = Data.ConfigFiles.FirstOrDefault(x => x.Id == file.Id); if (old == null) { CreateConfigFile(file); return; } else { old = file; save(); } }
public void SetInstance(ConfigFile file) { instance = file; }
static void CreateConfigFile(ConfigFile file) { if (Data.ConfigFiles == null) { Data.ConfigFiles = new List<ConfigFile>(); } if (string.IsNullOrEmpty(file.Id)) file.Id = Guid.NewGuid().ToString(); Data.ConfigFiles.Add(file); save(); }