Example #1
0
        public void saveFile()
        {
            string fileName = "product.txt";

            Ultilities.WriteSerialObjectToFile(fileName, Program.product);
            this.Hide();
            Program.orderForm.Show();
        }
Example #2
0
        private void saveFile()
        {
            List <Hero> heroes = new List <Hero>();

            heroes.Add(Program.character);
            string CombinedPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\Results\\Henry.txt");

            Ultilities.WriteSerialObjectToFile(CombinedPath, heroes);
        }
Example #3
0
        private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string CombinedPath = System.IO.Path.Combine(Directory.GetCurrentDirectory(), "..\\..\\Results");

            SaveFileDialog saveFileDialog1 = new SaveFileDialog();

            saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
            //saveFileDialog1.FilterIndex = 2;
            saveFileDialog1.RestoreDirectory = true;
            //saveFileDialog1.InitialDirectory = CombinedPath;
            saveFileDialog1.FileName = "Product.txt";
            //saveFileDialog1.InitialDirectory = "C:\\Users\\";
            //saveFileDialog1.InitialDirectory = "..\\..\\Results";

            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                string fileName = saveFileDialog1.FileName;
                Ultilities.WriteSerialObjectToFile(fileName, Program.product);
            }
        }