Example #1
0
        void GraphEditor_ExcludeEntity(object sender, NodeEventArgs e)
        {
            if (e.Node.UserData is Submodel.NodeLocalType model)
            {
                Model.ExcludeFromCurrentModel(model);
            }

            ReloadGraph();
            Model.Invalidate();
            RefreshNodeCombobox();
            CloseNodeEditor();
            EnableDisableButtons();
        }
Example #2
0
        void GraphEditor_NodeSelected(object sender, NodeEventArgs e)
        {
            if (!(e.Node.UserData is Submodel.NodeLocalType))
            {
                throw new NotSupportedException();
            }

            selectedNode = e.Node.UserData as Submodel.NodeLocalType;

            if (tsbEdgeInsertion.Checked)
            {
                return;
            }

            ShowEntityEditor();

            DefaultOrExpandPropertiesWidth(false);
        }
Example #3
0
        void GraphEditor_DeleteEntity(object sender, NodeEventArgs e)
        {
            if (e.Node.UserData is Submodel.NodeLocalType node)
            {
                DialogResult dialogResult = MessageBox.Show($@"Are you sure you want to delete the {EntityNodeName.ToLower()} ""{node.Label}"" from storage?", "WARNING!", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (dialogResult == DialogResult.Yes)
                {
                    Model.DeleteEntity(node);
                    ReloadGraph();

                    Model.Invalidate();
                    RefreshNodeCombobox();
                    CloseNodeEditor();
                    EnableDisableButtons();
                }
            }
        }