コード例 #1
0
ファイル: Converter.cs プロジェクト: sto276/CLEM_Converters
        public void UpdateSettings()
        {
            var settings = ConverterSettings.Read();

            Shared.InDir             = settings.InDirectory;
            Shared.OutDir            = settings.OutDirectory;
            includeIAT.Checked       = settings.IncludeIAT;
            groupSheets.Checked      = settings.GroupSheets;
            groupSimulations.Checked = settings.GroupSims;
            includeNABSA.Checked     = settings.IncludeNABSA;
        }
コード例 #2
0
ファイル: Converter.cs プロジェクト: sto276/CLEM_Converters
        private void CloseConverter(object sender, EventArgs e)
        {
            ConverterSettings settings = new ConverterSettings()
            {
                InDirectory  = Shared.InDir,
                OutDirectory = Shared.OutDir,
                IncludeIAT   = includeIAT.Checked,
                GroupSheets  = groupSheets.Checked,
                GroupSims    = groupSimulations.Checked,
                IncludeNABSA = includeNABSA.Checked
            };

            settings.Write();
        }
コード例 #3
0
        public static ConverterSettings Read()
        {
            string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
                          + "/CLEMConverter/settings.json";

            if (File.Exists(path))
            {
                string            json     = File.ReadAllText(path);
                ConverterSettings settings = (new JavaScriptSerializer()).Deserialize <ConverterSettings>(json);
                return(settings);
            }

            return(new ConverterSettings());
        }