Ejemplo n.º 1
0
        //Read Both Inputs and Show the Form If Inputs Aren't Blank
        private void Execute_btn_Click(object sender, System.EventArgs e)
        {
            var forms = GetOpenForms();

            DisposeUnusedForms(forms);
            var allTextBoxes = Input_panel.Controls.OfType <TextBox>();

            if (_inputHandler.IsValidInput(allTextBoxes))
            {
                var fileName = TextFile_txtBox.Text;
                var dirPath  = Directory_txtBox.Text;
                _songListManager.MasterSongList = _fileReader.Read(fileName);
                _songListManager.QuerySongList  = _directoryReader.Read(dirPath);
                var dataSet = new DataSet(_songListManager, dirPath);
                _textFileTable = new TextFileTable_Form(dataSet);
                _queryTable    = new QueryTable_form(dirPath, dataSet);
                _textFileTable.Show();
                _queryTable.Show();
            }
            else
            {
                var title   = "Invalid!";
                var message = "Please make sure 2 selections have been made";
                MessageBox.Show(message, title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Ejemplo n.º 2
0
        public void Read(string path)
        {
            var expression = new Regex("^KV");
            var files      = Directory.EnumerateFiles(path);

            foreach (var file in files)
            {
                var   fileName = Path.GetFileNameWithoutExtension(file);
                Match match    = expression.Match(fileName);
                if (match.Success && !fileName.EndsWith(".txt"))
                {
                    Song.songQueryList.Add(GetSong(fileName));
                }
            }

            var dataTableForm = new QueryTable_form();

            dataTableForm.Show();
        }