Beispiel #1
0
        private void экспортСхемToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //самый главный элемент
            string result = "";

            foreach (var i in mainWorkList)
            {
                i.drawPlaceExp(ref result);
                i.drawConExp(ref result);
                i.drawBoxExp(ref result);
                i.drawStrExp(ref result);
            }
            foreach (var i in wires)
            {
                i.drawPlaceExp(ref result);
                i.drawConExp(ref result);
                i.drawBoxExp(ref result);
                i.drawStrExp(ref result);
            }
            foreach (var i in rooms)
            {
                for (int j = 0; j < 4; j++)
                {
                    i.drawExp(ref result, j);
                }
            }
            ConnectionController.ExportUGO(ref result);
            SaveFileDialog file = new SaveFileDialog();

            file.Filter = "Script files (*.scr)|*.scr";
            if (file.ShowDialog() == DialogResult.OK)
            {
                File.Create(file.FileName).Close();
                File.WriteAllText(file.FileName, result, Encoding.GetEncoding(1251));
            }
        }