Ejemplo n.º 1
0
        private void Button_Click_Remove_Grad(object sender, RoutedEventArgs e)
        {
            CriterionForm       parent     = (sender as ButtonWithParent).criterionParent;
            GradationWithButton gradParent = (sender as ButtonWithParent).gradationParent;

            parent.betweenSP.Children.Remove(parent.gradationsList[parent.gradationsList.IndexOf(gradParent)].line);
            parent.gradationsList.Remove(gradParent);
        }
Ejemplo n.º 2
0
        private void Button_Click_Add_Grad(object sender, RoutedEventArgs e)
        {
            CriterionForm parent = (sender as ButtonWithParent).criterionParent;

            parent.gradationsList.Add(new GradationWithButton(parent));
            parent.gradationsList[parent.gradationsList.Count - 1].removeGrad.Click += Button_Click_Remove_Grad;
            parent.betweenSP.Children.Add(parent.gradationsList[parent.gradationsList.Count - 1].line);
        }
Ejemplo n.º 3
0
        public GradationWithButton(CriterionForm parent)
        {
            removeGrad = new ButtonWithParent(parent, this);
            Image img = new Image();

            img.Source         = new BitmapImage(new Uri(@"img/esc2.png", UriKind.RelativeOrAbsolute));
            img.Width          = 15;
            removeGrad.Content = img;
            removeGrad.Margin  = new Thickness(10, 0, 0, 0);
            line.Children.Add(this.removeGrad);
        }
Ejemplo n.º 4
0
        private void Button_Click_Remove_Form(object sender, RoutedEventArgs e)
        {
            CriterionForm parent = (sender as ButtonWithParent).criterionParent;

            if (parent.positive)
            {
                if (countPos > 1)
                {
                    addCritPanel.Children.Remove(parent.border);
                    criterionList.Remove(parent);
                    countPos--;
                }
            }
            if (!parent.positive)
            {
                if (countNeg > 1)
                {
                    addCritPanelNeg.Children.Remove(parent.border);
                    criterionList.Remove(parent);
                    countNeg--;
                }
            }
        }
Ejemplo n.º 5
0
        private void Button_Click_Add_Critrrian(object sender, RoutedEventArgs e)
        {
            CriterionForm parent = (sender as ButtonWithParent).criterionParent;

            createForm(parent.positive);
        }
Ejemplo n.º 6
0
 public ButtonWithParent(CriterionForm criterionParent, GradationWithButton gradationParent)
 {
     this.Style           = (Style)Application.Current.Resources["Buttons"];
     this.criterionParent = criterionParent;
     this.gradationParent = gradationParent;
 }