Esempio n. 1
0
        void Button_Click(object sender, RoutedEventArgs e)
        {
            if (buttonStateIsNew) // new
            {
                IVertex baseVertex = Vertex.Get(@"BaseEdge:\From:");
                IVertex meta       = Vertex.Get(@"BaseEdge:\Meta:");

                IVertex newVertex = VertexOperations.AddInstanceByEdgeVertex(baseVertex, meta);

                GraphUtil.CreateOrReplaceEdge(Vertex.Get(@"BaseEdge:"), MinusZero.Instance.Root.Get(@"System\Meta\ZeroTypes\Edge\To"), newVertex);

                if (newVertex != null)
                {
                    ButtonSetOpen();
                }
            }
            else // open
            {
                FormVisualiser v = (FormVisualiser)UIWpf.getParentFormVisualiser(this);

                if (v != null)
                {
                    Edge.CopyAndReplaceEdge(v.Vertex, "BaseEdge", Vertex.Get("BaseEdge:"));
                }
                else
                {
                    //BaseCommands.Open(Vertex.Get("BaseEdge:"), null); // want Form visualiser
                    BaseCommands.OpenFormVisualiser(Vertex.Get("BaseEdge:"));
                }
            }
        }
Esempio n. 2
0
        protected override void OnClick()
        {
            FormVisualiser v = (FormVisualiser)UIWpf.getParentFormVisualiser(this);

            if (v != null)
            {
                Edge.ReplaceEdgeEdges(v.Vertex.Get("BaseEdge:"), BaseEdge);
            }
            else
            {
                IVertex v2 = MinusZero.Instance.CreateTempVertex();
                Edge.AddEdgeEdges(v2, BaseEdge);

                //BaseCommands.Open(v2,null); // want Form Visuliser always
                BaseCommands.OpenFormVisualiser(v2);
            }
        }