示例#1
0
        private void Node_CustomizeButton_Click(object sender, EventArgs e)
        {
            groove groove_form = new groove(ID, position, Side);

            groove_form.Owner = this;
            groove_form.ShowDialog();
        }
示例#2
0
        private void combo_last_DropDownClosed(object sender, EventArgs e)
        {
            try
            {
                if (NODE.comb_last_feauter.SelectedItem.ToString() == "no feature")
                {
                }
                else if (NODE.comb_last_feauter.SelectedItem.ToString() == "Ring")
                {
                    Ring ring_form = new Ring(NODE.NodePosition);
                    ring_form.Owner = this;
                    ring_form.ShowDialog();

                    if (!Ring.canceled)
                    {
                        //addInForm.buttonTree1.Add(addInForm.nodes[addInForm.nodes.Count - 1]);
                        addInForm.buttonTree1.ReLoad();
                    }
                }
                else if (NODE.comb_last_feauter.SelectedItem.ToString() == "Groove")
                {
                    groove groove_form = new groove(NODE.NodePosition);
                    groove_form.Owner = this;
                    groove_form.ShowDialog();

                    if (!groove.canceled)
                    {
                        //addInForm.buttonTree1.Add(addInForm.nodes[addInForm.nodes.Count - 1]);
                        addInForm.buttonTree1.ReLoad();
                    }
                }
                else if (NODE.comb_last_feauter.SelectedItem.ToString() == "Undefined")
                {
                    MessageBox.Show("Undefined");
                }
            }
            catch (Exception) { MessageBox.Show("You have to change somethig"); }
        }
示例#3
0
        private bool chek(double Diameter, double Lenght)
        {
            MessageBoxButtons buttons = MessageBoxButtons.YesNoCancel;
            string            caption = "Error";
            double            lenght  = Lenght;
            DialogResult      result;
            bool chek = true;

            for (int i = 0; i <= var_es.feature_list.Count - 1; i++)
            {
                Feature n = var_es.feature_list[i];
                if (n.GetType().ToString() == "InvAddIn.ring")
                {
                    if (Diameter / 2 <= n.Radius)
                    {
                        result = MessageBox.Show("One of retailing ring features has wrong radius value, delete this feature?", caption, buttons);
                        if (result == DialogResult.Yes)
                        {
                            addInForm.Delete();
                            var_es.feature_list.RemoveAt(i);
                            addInForm.nodes.RemoveAt(n.Position);
                            addInForm.NODES[ID].RemoveAt(n.Node_Position);
                            addInForm.buttonTree1.ReLoad();
                        }
                        else if (result == DialogResult.No)
                        {
                            Ring _ring = new Ring(ID, n.Node_Position, n.Side);
                            _ring.Owner = this;
                            _ring.ShowDialog();
                        }
                        else
                        {
                            chek = false;
                            return(chek);
                        }
                    }
                    lenght -= n.Distance + n.Width;
                }
                else
                {
                    var x = n as Groove;
                    if (Diameter / 2 <= n.Depth)
                    {
                        result = MessageBox.Show("One of groove features has wrong depth value, delete this feature?", caption, buttons);
                        if (result == DialogResult.Yes)
                        {
                            addInForm.Delete();
                            var_es.feature_list.RemoveAt(i);
                            addInForm.nodes.RemoveAt(n.Position);
                            addInForm.NODES[ID].RemoveAt(n.Node_Position);
                            addInForm.buttonTree1.ReLoad();
                        }
                        else if (result == DialogResult.No)
                        {
                            groove _groove = new groove(ID, n.Node_Position, n.Side);
                            _groove.Owner = this;
                            _groove.ShowDialog();
                        }
                        else
                        {
                            chek = false;
                            return(chek);
                        }
                    }
                    lenght -= n.Distance + x.Hord;
                }
                if (lenght <= 0)
                {
                    result = MessageBox.Show("Summ of all features lenght is higher than lenght of figure you need to fix this before decresing figure lenght", caption, MessageBoxButtons.OK);
                    if (result == DialogResult.OK)
                    {
                        chek = false;
                        return(chek);
                    }
                }
            }
            return(chek);
        }