コード例 #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);
        }
コード例 #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);
        }
コード例 #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);
        }
コード例 #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--;
                }
            }
        }
コード例 #5
0
        private void Button_Click_Add_Critrrian(object sender, RoutedEventArgs e)
        {
            CriterionForm parent = (sender as ButtonWithParent).criterionParent;

            createForm(parent.positive);
        }
コード例 #6
0
 public ButtonWithParent(CriterionForm criterionParent, GradationWithButton gradationParent)
 {
     this.Style           = (Style)Application.Current.Resources["Buttons"];
     this.criterionParent = criterionParent;
     this.gradationParent = gradationParent;
 }