Example #1
0
        private bool saveListFile(List <string> list, string fileName, string fileType, string type)
        {
            if ((MessageBox.Show(LocRM.GetString("wishToSave", currentCulture) + type + " '" + fileName + "' ?", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.OK))
            {
                StrList strlist = ListController.CreateList(list, fileName, fileType);

                if (strlist.exists())
                {
                    DialogResult dialogResult = MessageBox.Show(LocRM.GetString("listExists", currentCulture), "", MessageBoxButtons.OKCancel);
                    if (dialogResult == DialogResult.Cancel)
                    {
                        MessageBox.Show(LocRM.GetString("listNotSaved", currentCulture));
                        return(false);
                    }
                }
                if (strlist.save())
                {
                    MessageBox.Show(LocRM.GetString("list", currentCulture) + fileName + LocRM.GetString("listSaveSuccess", currentCulture));
                }
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #2
0
        public void TestStrListSaveFile()
        {
            bool testSaved = testList.save();

            Assert.IsTrue(testSaved);
        }