コード例 #1
0
        /// <summary>
        /// Возвращается к предыдущему окну.
        /// </summary>
        /// <param name="sender">CodeDescriptionWindow</param>
        /// <param name="e">RoutedEventArgs</param>
        private void PreviousWindowButton_Click(object sender, RoutedEventArgs e)
        {
            CodeGeneratingWindow win = new CodeGeneratingWindow();

            win.Top  = this.Top;
            win.Left = this.Left;
            win.equations.Document.Blocks.Clear();
            for (int i = 0; i < AGCode.SystemOfEquations.Length; i++)
            {
                win.equations.Document.Blocks.Add(new Paragraph(new Run(AGCode.SystemOfEquations[i])));
            }
            win.size.SelectedIndex = AGCode.K - 1;
            win.Show();
            this.Close();
        }
コード例 #2
0
        /// <summary>
        /// Отмечает, какой код выбран, или открывает окно для создания нового кода.
        /// </summary>
        /// <param name="sender">SelectCodeWindow</param>
        /// <param name="e">SelectionChangedEventArgs</param>
        private void codeSelectorComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ComboBox     comboBox     = (ComboBox)sender;
            ComboBoxItem selectedItem = (ComboBoxItem)comboBox.SelectedItem;

            if (selectedItem != null)
            {
                itemName = selectedItem.Content.ToString();
            }

            if (itemName == "Cоздать новый код...")
            {
                CodeGeneratingWindow win2 = new CodeGeneratingWindow();
                win2.Top  = this.Top;
                win2.Left = this.Left;
                win2.Show();
                this.Close();
            }
        }
コード例 #3
0
 /// <summary>
 /// Переходит к окну с характеристиками выбранного кода или к окну для создания нового кода.
 /// </summary>
 /// <param name="sender">SelectCodeWindow</param>
 /// <param name="e">RoutedEventArgs</param>
 private void nextWindowButton_Click(object sender, RoutedEventArgs e)
 {
     if ((codeSelector.SelectedIndex >= 0) && (codeSelector.SelectedIndex < codes.Count))
     {
         CodeDescriptionWindow win2 = new CodeDescriptionWindow(codes[codeSelector.SelectedIndex]);
         win2.Top  = this.Top;
         win2.Left = this.Left;
         win2.Show();
         this.Close();
     }
     else
     if (itemName == "Cоздать новый код...")
     {
         CodeGeneratingWindow win2 = new CodeGeneratingWindow();
         win2.Top  = this.Top;
         win2.Left = this.Left;
         win2.Show();
         this.Close();
     }
     else
     {
         codeSelector.IsDropDownOpen = true;
     }
 }