public void Delete(TheoryTypes type, int theoryindex, string formulation, string template, string proof)
 {
     ITheoryElement element = null;
     switch (type)
     {
         case TheoryTypes.Corollary: element = new Corollary(theoryindex, formulation, template); break;
         case TheoryTypes.Definition: element = new Definition(theoryindex, formulation, template); break;
         case TheoryTypes.Lemma: element = new Lemma(theoryindex, formulation, template); break;
         case TheoryTypes.Postulate: element = new Postulate(theoryindex, formulation, template); break;
         case TheoryTypes.Theorem: element = new Theorem(theoryindex, formulation, template, proof); break;
     }
     tree.Remove(element);
 }
        public CreateElementPanel(ITheoryElement element, List<ITheoryElement> basis, Core.Session session, TheoryTree tree)
        {
            InitializeComponent();
            this.element = element;
            this.basis = basis;
            this.currentSession = session;
            this.type = element.GetTheoryType();
            this.tree = tree;

            TheoryTypeBox.Text = type.ToString();
            LinksItemBox.ItemsSource = basis;
            FormulationTextBox.Text = element.Formulation;
            TemplateTextBox.Text = element.Template;
            if (element is Theorem)
                ProofTextBox.Text = ((Theorem)element).Proof;
            mod = Mods.Edit;
            LanguageResource.Updated += new Updated(LanguageResource_Updated);
            Update();
            LanguageResource_Updated(null);
        }
示例#3
0
 public bool AddTheoryElement(TheoryTypes type, int theoryindex, string formulation, string template, string proof, List<ITheoryElement> newbasis)
 {
     try
     {
         treeController.Add(type, theoryindex, formulation, template, proof, newbasis);
         return true;
     }
     catch (Exception e)
     {
         exceptionHandler.Add(e);
         return false;
     }
 }
示例#4
0
 public void DeleteTheoryElement(TheoryTypes type, int theoryindex, string formulation, string template, string proof)
 {
     try
     {
         treeController.Delete(type, theoryindex, formulation, template, proof);
     }
     catch (Exception e)
     {
         exceptionHandler.Add(e);
     }
 }
        /// <summary>
        /// Метод обрабатывающий нажатие кнопки выбора типа теории.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ChooseTypeButton_Click(object sender, RoutedEventArgs e)
        {
            MessageListBox b = MessageListBox.Show(Core.TheoryTypesClass.GetTypes(), MessageListBox.Mods.Choose);
            if (b.notcanceled)
            {
                type = TheoryTypesClass.GetType((string)b.choosenElement);
                typechoosen = true;

                Update();
                LanguageResource_Updated(null);
            }
        }