Ejemplo n.º 1
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();
        }
Ejemplo n.º 2
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;
     }
 }