コード例 #1
0
 private string ReadFromFile()
 {
     if (!FileProvider.IsExist(FilePaths.TrainingPath))
     {
         FileProvider.Create(FilePaths.TrainingPath);
     }
     return(FileProvider.Read(FilePaths.TrainingPath));
 }
コード例 #2
0
        private void documentLinkLabel_Click(object sender, EventArgs e)
        {
            var documentLabel = (LinkLabel)sender;
            var document      = (Document)documentLabel.Tag;

            if (FileProvider.IsExist(document.Path))
            {
                System.Diagnostics.Process.Start(document.Path);
            }
            else
            {
                var result = MessageBox.Show("Такой документ отсутствует или был удалён.\nУдалить ссылку на документ?",
                                             "Файл не найден!", MessageBoxButtons.YesNo);
                if (result == DialogResult.No)
                {
                    return;
                }
                projectService.DeleteDocument(document);
                currentOperation.Documents.Remove(document);
                ClearOperationDetails();
                FillOperationDetails(currentOperation);
            }
        }