Ejemplo n.º 1
0
        public static void Save(string StageName, ConfigStage stage)
        {
            string stageConfigFileName = AppSettings.WizardStagesConfigPath + "\\" + StageName + ".json";
            string jsonData            = Newtonsoft.Json.JsonConvert.SerializeObject(stage);

            System.IO.StreamWriter sw = new System.IO.StreamWriter(AppSettings.WizardStagesConfigPath + "\\" + StageName + ".json");
            sw.Write(jsonData);
            sw.Close();
        }
Ejemplo n.º 2
0
        public static ConfigStage LoadStage(string StageName)
        {
            string stageConfigFileName = AppSettings.WizardStagesConfigPath + "\\" + StageName + ".json";

            if (System.IO.File.Exists(stageConfigFileName))
            {
                string      json   = System.IO.File.ReadAllText(stageConfigFileName);
                ConfigStage config = Newtonsoft.Json.JsonConvert.DeserializeObject <ConfigStage>(json);
                return(config);
            }
            else
            {
                return(new ConfigStage()
                {
                    WizardStepDescription = "",
                    WizardStepTitle = "Unknown stage"
                });
            }
        }