Example #1
0
        public void LangCreateTest()
        {
            GenerateTestData();

            using (LNG lng = new LNG())
            {
                Assert.IsNotNull(lng, "LNG class empty ctor failed.");

                lng.Entries.AddRange(testlist);
                lng.Save(filenameLng);
            }

            Assert.IsTrue(File.Exists(filenameLng), "Test file doesn't exist.");

            LangParseTest();
        }
Example #2
0
        private void actionSave_Click(object sender, EventArgs e)
        {
            //if number of lines changed, ask user if he still wants to save
            if (langBox.Lines.Length != linesOnLoad && linesOnLoad != 0)
            {
                if (MessageBox.Show($"{msg1}\r\n{msg2}", "Warning", MessageBoxButtons.YesNo) == DialogResult.No)
                {
                    return;
                }
            }

            if (sfd.ShowDialog() == DialogResult.OK)
            {
                lng = LNG.FromText(langBox.Lines);
                lng.Save(sfd.FileName);
                linesOnLoad = lng.Entries.Count;
            }
        }