private async Task FillCollectionsAsync()
        {
            List <string> list = await DataGetSet.GetGenresAsync();

            list.Insert(0, "NA");
            _genres = new ObservableCollection <string>(list);

            list = await DataGetSet.GetCatalogsAsync();

            list.Insert(0, "NA");
            _catalogs = new ObservableCollection <string>(list);

            list = await DataGetSet.GetMediaAsync();

            list.Insert(0, "NA");
            _medias = new ObservableCollection <string>(list);

            list = new List <string>();      // await DataGetSet.GetInterpretersAsync();
            list.Add("NA");
            _artists = new ObservableCollection <string>(list);

            list = new List <string>();      // await DataGetSet.GetAlbumsAsync();
            list.Add("NA");
            _albums = new ObservableCollection <string>(list);
        }
Ejemplo n.º 2
0
        //bool IsFieldChanged(Control c)
        //{
        //    //Dim strValueNew$, strValueOld$, strFieldName$, strCtype

        //    //bool IsFieldChanged = false;

        //    //strCtype = TypeName(Contr)
        //    //Debug.Print strCtype

        //    //Select Case strCtype
        //    //  Case "TextBox"
        //    //      strValueOld = Contr.Tag
        //    //      strValueNew = Contr.Text

        //    //  Case "CheckBox"
        //    //      strValueOld = Contr.Tag
        //    //      strValueNew = Contr.Value

        //    //  Case Else

        //    //End Select

        //    //If strValueOld = strValueNew Then
        //    //  IsFieldChanged = False
        //    //Else
        //    return true;
        //    //End If

        //}

        #endregion

        #region Methods
        private async Task FillFormAsync()
        {
            List <string> record = null;

            try
            {
                // fill combo genres
                List <string> genres = await DataGetSet.GetGenresFullAsync();

                foreach (string genre in genres)
                {
                    comboBoxGenre.Items.Add(genre);
                }

                // fill combo catalogs
                List <string> catalogs = await DataGetSet.GetCatalogsAsync();

                foreach (string catalog in catalogs)
                {
                    comboBoxCatalog.Items.Add(catalog);
                }

                record                = DataGetSet.GetSongRecord(_id);
                textBoxID.Text        = record[0];
                comboBoxGenre.Text    = record[1];
                comboBoxCatalog.Text  = record[2];
                textBoxAlbum.Text     = record[3];
                textBoxInterpret.Text = record[4];
                textBoxTitel.Text     = record[5];
                textBoxPath.Text      = record[6];
                textBoxFilename.Text  = record[7];

                record = DataGetSet.GetFileRecord(_id);
                textBoxFilesize.Text = record[0];
                textBoxFiledate.Text = record[1];
                textBoxDuration.Text = record[2];

                record                = DataGetSet.GetInfoRecord(_id);
                textBoxBeat.Text      = record[0];
                textboxComment.Text   = record[1];
                textBoxMedia.Text     = record[2];
                textBoxPlayed.Text    = record[3];
                textBoxRating.Text    = record[4];
                chechBoxSampler.Text  = record[5];
                checkBoxError.Checked = Convert.ToBoolean(record[6]);
            }
            catch
            { }

            _formloaded = true;
        }