示例#1
0
 private void UpdateSelectedPostcondition()
 {
     if (listBoxPostconditions.SelectedIndex >= 0)
     {
         selectedPostcondition = listBoxPostconditions.SelectedItem as LinkedOclCondition;
         selectedCondition     = null;
         this.listBoxLinkedPreconditions.UnselectAll();
         selectedCondition = selectedPostcondition;
         UpdateConditionControls();
         this.listBoxLinkedPreconditions.IsEnabled = true;
         List <OclCondition> linkedConditions = (selectedCondition as LinkedOclCondition).LinkedConditions;
         foreach (OclCondition c in linkedConditions)
         {
             this.listBoxLinkedPreconditions.SelectedItems.Add(c);
         }
     }
     else
     {
         this.selectedCondition            = null;
         this.selectedPostcondition        = null;
         comboBoxComparator.SelectedIndex  = -1;
         textBoxArgumentLeft.Text          = "";
         textBoxArgumentRight.Text         = "";
         checkBoxInvertCondition.IsChecked = false;
         textBoxExceptionCondition.Text    = "";
     }
 }
示例#2
0
 private void UpdateSelectedPrecondition()
 {
     if (listBoxPreconditions.SelectedIndex >= 0)
     {
         selectedPrecondition = listBoxPreconditions.SelectedItem as OclCondition;
         selectedCondition    = selectedPrecondition;
         UpdateConditionControls();
         this.listBoxLinkedPreconditions.IsEnabled = false;
         this.listBoxLinkedPreconditions.UnselectAll();
     }
     else
     {
         selectedCondition                 = null;
         selectedPrecondition              = null;
         comboBoxComparator.SelectedIndex  = -1;
         textBoxArgumentLeft.Text          = "";
         textBoxArgumentRight.Text         = "";
         checkBoxInvertCondition.IsChecked = false;
         textBoxExceptionCondition.Text    = "";
     }
 }
示例#3
0
        private void comboBoxMethod_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (comboBoxClass.SelectedIndex >= 0 && comboBoxMethod.SelectedIndex >= 0)
            {
                string        selectedClass  = comboBoxClass.SelectedValue.ToString();
                string        selectedMethod = comboBoxMethod.SelectedValue.ToString();
                UmlClassNode  classNode      = classes[selectedClass];
                UmlMethodNode methodNode     = classNode.Methods[selectedMethod];

                this.selectedMethod        = methodNode;
                this.selectedCondition     = null;
                this.selectedPrecondition  = null;
                this.selectedPostcondition = null;

                this.listBoxPreconditions.ItemsSource = this.selectedMethod.Preconditions;
                this.listBoxPreconditions.Items.Refresh();
                this.listBoxPostconditions.ItemsSource = this.selectedMethod.Postconditions;
                this.listBoxPostconditions.Items.Refresh();
                this.listBoxLinkedPreconditions.ItemsSource = this.selectedMethod.Preconditions;
                this.listBoxLinkedPreconditions.Items.Refresh();
            }
        }