示例#1
0
        private void ShowScenarios()
        {
            ADAMobileDataSet.ScenarioRow lastScenarioRow = null;

            if (_scenarioRow != null)
            {
                lastScenarioRow = _scenarioRow;
                _scenarioRow    = null;
            }

            symbolListView1.Items.Clear();

            DataRow[] dataRows = adaScenarioDataSet1.Scenario.Select("", "Name ASC");
            int       count    = dataRows.Length;

            int selectedScenario = (count > 0 ? 0 : -1);

            for (int i = 0; i < count; i++)
            {
                ADAMobileDataSet.ScenarioRow  row  = dataRows[i] as ADAMobileDataSet.ScenarioRow;
                SymbolListView.SymbolListItem item = new SymbolListView.SymbolListItem();

                if (!row.IsSymbolIdNull())
                {
                    if (!row.SymbolRow.IsImageNull())
                    {
                        item.Image = ImageEngine.FromArray(row.SymbolRow.Image);
                    }

                    if (!row.SymbolRow.IsSoundNull())
                    {
                        item.Sound = row.SymbolRow.Sound;
                    }
                }

                item.Text = row.Name;

                symbolListView1.Items.Add(item);

                if (lastScenarioRow == row)
                {
                    selectedScenario = i;
                }
            }

            if (selectedScenario >= 0)
            {
                symbolListView1.SelectedIndex = selectedScenario;
            }

            menuItemSelect.Text = "Select";

            this.Text = "Select Scenario";
            symbolListView1.Invalidate();
            symbolListView1.Focus();

            EnablePrevNextPageMenuItems();
        }
示例#2
0
 private void menuItemSelect_Click(object sender, EventArgs e)
 {
     if (_scenarioRow == null)
     {
         DataRow[] dataRows = adaScenarioDataSet1.Scenario.Select("", "Name ASC");
         ADAMobileDataSet.ScenarioRow row = dataRows[symbolListView1.SelectedIndex] as ADAMobileDataSet.ScenarioRow;
         ShowTextButtons(row);
     }
     else
     {
         ShowDetail(symbolListView1.SelectedIndex);
     }
 }
示例#3
0
        private void ShowTextButtons(ADAMobileDataSet.ScenarioRow scenarioRow)
        {
            int scenarioId = scenarioRow.ScenarioId;

            _scenarioRow = scenarioRow;

            symbolListView1.Items.Clear();

            DataRow[] dataRows = adaScenarioDataSet1.Text.Select("ScenarioId=" + scenarioId, "Name ASC");
            int       count    = dataRows.Length;

            for (int i = 0; i < count; i++)
            {
                ADAMobileDataSet.TextRow      textRow = dataRows[i] as ADAMobileDataSet.TextRow;
                SymbolListView.SymbolListItem item    = new SymbolListView.SymbolListItem();

                if (!textRow.IsSymbolIdNull())
                {
                    if (!textRow.SymbolRow.IsImageNull())
                    {
                        item.Image = ImageEngine.FromArray(textRow.SymbolRow.Image);
                    }

                    if (!textRow.SymbolRow.IsSoundNull())
                    {
                        item.Sound = textRow.SymbolRow.Sound;
                    }
                }

                item.Text = textRow.Name;

                symbolListView1.Items.Add(item);
            }

            if (count > 0)
            {
                symbolListView1.SelectedIndex = 0;
            }

            symbolListView1.Invalidate();
            symbolListView1.Focus();

            menuItemSelect.Text = "Detail";

            this.Text = scenarioRow.Name;

            EnablePrevNextPageMenuItems();
        }
示例#4
0
 private void symbolListView1_ItemActivated(object sender, EventArgs args)
 {
     if (_scenarioRow != null)
     {
         Cursor.Current = Cursors.WaitCursor;
         _dftts.SayIt(textBox1.Text);
         //_tts.SayIt(textBox1.Text);
         Cursor.Current = Cursors.Default;
     }
     else
     {
         DataRow[] dataRows = adaScenarioDataSet1.Scenario.Select("", "Name ASC");
         ADAMobileDataSet.ScenarioRow row = dataRows[symbolListView1.SelectedIndex] as ADAMobileDataSet.ScenarioRow;
         ShowTextButtons(row);
     }
 }
示例#5
0
 void symbolListView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (symbolListView1.SelectedIndex < 0)
     {
         textBox1.Text = "";
     }
     else if (_scenarioRow != null)
     {
         DataRow[] dataRows = adaScenarioDataSet1.Text.Select("ScenarioId=" + _scenarioRow.ScenarioId, "Name ASC");
         ADAMobileDataSet.TextRow textRow = dataRows[symbolListView1.SelectedIndex] as ADAMobileDataSet.TextRow;
         textBox1.Text = textRow.Descripton;
     }
     else
     {
         DataRow[] dataRows = adaScenarioDataSet1.Scenario.Select("", "Name ASC");
         ADAMobileDataSet.ScenarioRow senarioRow = dataRows[symbolListView1.SelectedIndex] as ADAMobileDataSet.ScenarioRow;
         textBox1.Text = senarioRow.Name;
     }
 }