Beispiel #1
0
        void getData()
        {
            if (instance == null)
            {
                instance = new ConfigFile();
            }

            instance.DeployFullLocation = txtLocation.Text;
            instance.Content = rtbContent.Text;
            instance.Remarks = rtbRemarks.Text;
        }
Beispiel #2
0
        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();
            }
        }
Beispiel #3
0
 public void SetInstance(ConfigFile file)
 {
     instance = file;
 }
Beispiel #4
0
        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();
        }