Beispiel #1
0
        private void AddClass_Click(object sender, RoutedEventArgs e)
        {
            var ed_class_dlg = new Edit_class_name();

            ed_class_dlg.SetNode(curNode);
            if (ed_class_dlg.ShowDialog() == true)
            {
                var p = graph.Nodes.Where(x => x.Text == ed_class_dlg.name).Count();
                if (p > 0)
                {
                    MessageBox.Show("Class with that name has already created.\nTry another name!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                }
                else
                {
                    if (curNode != null && curNode.Selected)
                    {
                        curNode.InvSelect();
                    }
                    curNode = new Node {
                        Pos = mousePress, Text = "Class " + (graph.Nodes.Count() + 1), Width = 100, Height = 100
                    };
                    graph.Nodes.Add(curNode);
                    curNode.InvSelect();
                    curNode.naMed = graph.HeaderName;

                    curNode.Text             = ed_class_dlg.name;
                    curNode.stereotype_index = ed_class_dlg.ster;
                    curNode.StereotypeVis();
                }
            }
        }
Beispiel #2
0
        private void EditClassName_Item_Click(object sender, RoutedEventArgs e)
        {
            var ed_class_dlg = new Edit_class_name();

            ed_class_dlg.SetNode(curNode);
            if (ed_class_dlg.ShowDialog() == true)
            {
                curNode.Text             = ed_class_dlg.name;
                curNode.stereotype_index = ed_class_dlg.ster;
                curNode.StereotypeVis();
            }
        }