Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            //F4
            bool isFileInfoType = totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0] is FileInfo;

            if (!isFileInfoType)
            {
                return;
            }
            ViewForm vf = new ViewForm();

            vf.MyTextBox = File.ReadAllText(totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0].FullName);
            //vf.MyTextBox = ".fm.mf.mf.mf";
            vf.Show();

            //StreamWriter sw = new StreamWriter(totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0].FullName);

            vf.FormClosing += (x, y) =>
            {
                if (MessageBox.Show("Записати зміни?", "Збереження змін", MessageBoxButtons.YesNo) == DialogResult.Yes)
                {
                    File.WriteAllText(totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0].FullName, vf.MyTextBox);
                }
                //sw.WriteLine(vf.MyTextBox);
            };
            //FileStream fs = new FileStream(totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0].FullName,FileMode.Open);
            //FileStream fs = ((FileInfo)totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0]).Open(FileMode.Open);
            //fs.Read()

            //fs.Close();
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            //F3
            bool isFileInfoType = totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0] is FileInfo;

            if (!isFileInfoType)
            {
                return;
            }
            ViewForm vf = new ViewForm();

            vf.MyTextBox = File.ReadAllText(totCommPanel1.foldersFilesPanel.selectedFoldersFiles[0].FullName);
            vf.Show();
        }