示例#1
0
 private void updateFileFieldView(string directoryName)
 {
     if (isNotEmpty(directoryName))
     {
         FileController controller = new FileController(directoryName);
         string         fileControllerException = controller.FileControllerException;
         listView1.Items.Clear();
         if (showException(fileControllerException))
         {
             DialogWithOneButtom error =
                 //new DialogWithOneButtom(fileControllerException);
                 new DialogWithOneButtom("Не правильно указан путь к файлам.");
             error.Show();
         }
         else
         {
             foreach (FileEntity fileEntity in controller.FileEntities)
             {
                 listView1.Items.Add(new ListViewItem(fileEntity.FullFileName));
             }
         }
     }
     else
     {
         DialogWithOneButtom error =
             new DialogWithOneButtom(Сonstants.FillDirectoryPathError);
         error.Show();
     }
 }
示例#2
0
        private void button5_Click(object sender, EventArgs e)
        {
            SelectedListViewItemCollection fileItems = listView1.SelectedItems;
            SelectedListViewItemCollection userItems = listView2.SelectedItems;
            int fileItemsCount = fileItems.Count;
            int userItemsCount = userItems.Count;

            if (fileItemsCount > 0 && userItemsCount > 0)
            {
                GraphForm graphForm = new GraphForm(fileItems, userItems);
                graphForm.Show();
            }
            else
            {
                if (fileItemsCount == 0 && userItemsCount == 0)
                {
                    DialogWithOneButtom error =
                        new DialogWithOneButtom(Сonstants.SelectUserAndFileError);
                    error.ShowDialog();
                }
                else if (userItemsCount == 0)
                {
                    DialogWithOneButtom error =
                        new DialogWithOneButtom(Сonstants.SelectUserError);
                    error.ShowDialog();
                }
                else
                {
                    DialogWithOneButtom error =
                        new DialogWithOneButtom(Сonstants.SelectFileError);
                    error.ShowDialog();
                }
            }
        }
示例#3
0
        private void showUserAccounts(object sender, EventArgs e)
        {
            UserEntityController controller      = UserEntityController.Instance;
            string userEntityControllerException =
                controller.UserEntityControllerException;

            if (showException(userEntityControllerException))
            {
                DialogWithOneButtom error =
                    new DialogWithOneButtom(userEntityControllerException);
                error.Show();
            }
            else
            {
                refreshListView(controller.UserEntities);
            }
        }