private void loadingAudioFilesToDataGrid()
        {
            string[] audioFiles = FileManipulation.GetAllFilesInFolder(path, "WAV");
            // Fills data grid view with .wav files from data directory
            if (audioFiles.Length != 0)
            {
                audioPathDataGridView.Rows.Clear();
                audioPathDataGridView.Refresh();
                currenFolderLabel.Text = path;

                DGVManipulation.ReadStringListIntoDGV(audioFiles, audioPathDataGridView);
                numberFiles.Text = audioPathDataGridView.RowCount.ToString();
            }
            else
            {
                /*path doesnt exist*/
            }
        }
        public FormDefine(string formTitle, string dataFolderPath, string fileType, string itemType, bool sufix, bool showCreateOption)
        {
            InitializeComponent();
            this.showCreateOption = showCreateOption;
            this.Text             = formTitle;
            string[] option;
            this.itemType = itemType;
            string[] itemTypes = { "image", "audio", "words", "color" };
            bool     isType    = false;

            type = fileType;
            comboBox1.Enabled = false;
            comboBox1.Visible = false;
            textBox1.Enabled  = false;
            textBox1.Visible  = false;

            if (itemType.Contains(itemTypes[0]) || itemType.Contains(itemTypes[1]) || itemType.Contains(itemTypes[2]) || itemType.Contains(itemTypes[3]))
            {
                isType = true;
            }

            if (type == "prg" || type == "lst" || type == "txt" || type == "data")
            {
                comboBox1.Enabled = true;
                comboBox1.Visible = true;

                filePaths = FileManipulation.GetAllFilesInFolder(dataFolderPath, fileType);
                for (int i = 0; i < filePaths.Length; i++)
                {
                    option = Path.GetFileNameWithoutExtension(filePaths[i]).Split('_');
                    if (isType)
                    {
                        if (itemType.Contains(option[1]) && !sufix)
                        {
                            comboBox1.Items.Add(option[0]);
                        }
                        else if (itemType.Contains(option[1]) && sufix)
                        {
                            comboBox1.Items.Add(option[0] + '_' + option[1]);
                        }
                    }
                    else
                    {
                        comboBox1.Items.Add(option[0]);
                    }
                }
            }
            else if (type == "dir")
            {
                comboBox1.Enabled = true;
                comboBox1.Visible = true;
                if (Directory.Exists(dataFolderPath))
                {
                    filePaths = Directory.GetDirectories(dataFolderPath, ("*" + itemType));
                    for (int i = 0; i < filePaths.Length; i++)
                    {
                        option = Path.GetFileName(filePaths[i]).Split('_');
                        comboBox1.Items.Add(option[0]);
                    }
                }
            }
            else
            {
                textBox1.Enabled = true;
                textBox1.Visible = true;
            }
            if (showCreateOption == true)
            {
                comboBox1.Items.Add(LocRM.GetString("createNewList", currentCulture));
            }
        }
Beispiel #3
0
 public static string[] GetAllParticipants()
 {
     return(FileManipulation.GetAllFilesInFolder(FileManipulation._participantDataPath, "data"));
 }