Example #1
0
        //создаем файл
        public string CreateFile(StackPanel spDesktop, string PrelimFileName = "")
        {
            CreateFile createFile = new CreateFile();
            string     FileName   = createFile.ShowDialog(Administrator, PrelimFileName);

            Administrator.AddFile(FileName, CurrentRole);
            AddFileOnDesk(FileName, spDesktop);
            return(FileName);
        }
Example #2
0
        private void BtAddFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();

            openFile.Filter = "Text files|*.txt;";

            if (!(bool)openFile.ShowDialog())
            {
                return;
            }
            string[] name           = openFile.FileName.Split(new char[] { '/', '\\', '.' });
            string   PrelimFileName = name[name.Length - 2];

            CreateFile createFile = new CreateFile();
            string     FileName   = createFile.ShowDialog(Administrator, PrelimFileName);

            Administrator.AddFile(FileName);
            File.Copy(openFile.FileName, @"Files\" + FileName, true);
            FillRightsMatrix();
            FillCbFiles();
        }