Exemplo n.º 1
0
        private void FillEditWindow(EditWindow wnd, Int32 index)
        {
            string[] questions = factoryList[index].AskClient();
            string[] answers1  = factoryList[index].Answer1();

            wnd.lEditParams1.Content = questions[0];
            for (Int32 j = 0; j < answers1.Length; j++)
            {
                wnd.AboutMenu1.Items.Add(answers1[j]);
            }

            wnd.lEditParams2.Content = questions[1];
            string[] answers2 = factoryList[index].Answer2();

            for (Int32 j = 0; j < answers2.Length; j++)
            {
                wnd.AboutMenu2.Items.Add(answers2[j]);
            }

            wnd.AboutMenu1.Text = wnd.AboutMenu1.Items[(Int32)factoryList[index].answers[0]].ToString();
            wnd.AboutMenu2.Text = (string)wnd.AboutMenu2.Items[(bool)factoryList[index].answers[2] ? 0 : 1];

            if ((bool)factoryList[index].answers[1])
            {
                wnd.Choose1.IsChecked = true;
            }
            else
            {
                wnd.Choose2.IsChecked = true;
            }

            wnd.lName.Content += factoryList[index].Name;

            wnd.Show();
        }
Exemplo n.º 2
0
 private void btChange_Click(object sender, RoutedEventArgs e)
 {
     for (Int32 i = 0; i < factoryList.Count; i++)
     {
         if (factoryList[i].Name.IsEqual(orderList[listBox.SelectedIndex].Name))
         {
             EditWindow window = new EditWindow(this, factoryList, imageList, orderList, listBox.SelectedIndex);
             FillEditWindow(window, i);
         }
     }
 }