Exemple #1
0
        private async void RefreshData()
        {
            contentData = await SpeechContentOps.GetContentData();

            Items = new List <ListViewItem>();

            foreach (SpeechContentItem scItem in contentData.Items)
            {
                ListViewItem lvItem = new ListViewItem();
                //lvItem.Background = Brushes.White;
                lvItem.Content = scItem;
                if (scItem.Index < contentData.Position)
                {
                    lvItem.Background = Brushes.LightSlateGray;
                }
                else
                {
                    lvItem.Foreground = Brushes.Black;
                }

                Items.Add(lvItem);
            }

            _lvData.ItemsSource = Items;


            _txtPosition.Text = contentData.Position.ToString();
        }
Exemple #2
0
        private void _butDown_Click(object sender, RoutedEventArgs e)
        {
            ListViewItem lvi   = (ListViewItem)(_lvData.SelectedItem);
            int          index = ((SpeechContentItem)(lvi.Content)).Index;

            SpeechContentOps.MoveContentItem(index, index + 1);
            RefreshData();
        }
Exemple #3
0
 private void _butCompress_Click(object sender, RoutedEventArgs e)
 {
     SpeechContentOps.DoCompressData();
     RefreshData();
 }
Exemple #4
0
 private void _butAdd_Click(object sender, RoutedEventArgs e)
 {
     SpeechContentOps.AddContent(_tboxContent.Text);
     RefreshData();
 }
Exemple #5
0
 private void _butSetPosition_Click(object sender, RoutedEventArgs e)
 {
     SpeechContentOps.SetPosition(Convert.ToInt32(_txtPosition.Text));
     RefreshData();
 }