internal static ConstsUniverse ShowModal(ConstsUniverse constsUniverse)
        {
            ValuesRedactor vr = new ValuesRedactor(constsUniverse);
            var            wd = new WindowValuesRedactor(vr);

            wd.ShowDialog();
            return(null);
        }
Example #2
0
        public void UpdateConsts()
        {
            string  configsPath = Environment.CurrentDirectory + @"\program_configs.txt";
            string  saveFile    = Environment.CurrentDirectory + @"\saved_un.txt";
            Process proc        = new Process();

            proc.StartInfo.FileName = configsPath;

            try
            {
                ConstsUniverse.FromXmlString(
                    File.ReadAllText(configsPath)
                    );
                char key = Console.ReadKey(true).KeyChar;
                if (key == 's')
                {
                    File.WriteAllText(
                        saveFile, BinarySerializer.ToBase64String(GetUniverse())
                        );
                }
                if (key != 'c')
                {
                    return;
                }
                proc.Start();
                while (!proc.HasExited)
                {
                    Thread.Sleep(500);
                }
            }
            catch
            {
                File.WriteAllLines(
                    configsPath, ConstsUniverse.ToXmlString().Split('\n')
                    );
            }
        }