예제 #1
0
        public static IVertex Delete(IVertex baseVertex, IVertex inputVertex)
        {
            IVertex info = m0.MinusZero.Instance.CreateTempVertex();

            info.Value = "DELETE vertex";

            IVertex options = m0.MinusZero.Instance.CreateTempVertex();

            options.AddVertex(null, "Edge delete");
            options.AddVertex(null, "Remove from repository");
            options.AddVertex(null, "Cancel");



            IVertex option = MinusZero.Instance.DefaultShow.SelectDialogButton(info, options, null);

            bool allEdgesDelete = false;


            if (option == null || GeneralUtil.CompareStrings(option.Value, "Cancel"))
            {
                return(null);
            }

            if (GeneralUtil.CompareStrings(option.Value, "Remove from repository"))
            {
                allEdgesDelete = true;
            }

            if (inputVertex.Get("SelectedEdges:").Count() == 0)
            {
                if (allEdgesDelete)
                {
                    VertexOperations.DeleteAllEdges(baseVertex.Get("To:"));
                }
                else
                {
                    VertexOperations.DeleteOneEdge(baseVertex.Get("From:"), baseVertex.Get("Meta:"), baseVertex.Get("To:"));
                }
            }
            else
            {
                IList <IEdge> selected = GeneralUtil.CreateAndCopyList(inputVertex.Get("SelectedEdges:"));
                foreach (IEdge v in selected)
                {
                    if (allEdgesDelete)
                    {
                        VertexOperations.DeleteAllEdges(v.To.Get("To:"));
                    }
                    else
                    {
                        VertexOperations.DeleteOneEdge(v.To.Get("From:"), v.To.Get("Meta:"), v.To.Get("To:"));
                    }
                }
            }

            return(null);
        }
예제 #2
0
        public static IVertex Paste(IVertex baseVertex, IVertex inputVertex)
        {
            foreach (IVertex v in CutPasteStore)
            {
                if (DoCut)
                {
                    VertexOperations.DeleteOneEdge(v.Get("From:"), v.Get("Meta:"), v.Get("To:"));
                }

                baseVertex.Get("To:").AddEdge(v.Get("Meta:"), v.Get("To:"));
            }

            return(null);
        }
예제 #3
0
 protected override void OnClick()
 {
     VertexOperations.DeleteOneEdge(BaseEdge.From, BaseEdge.Meta, BaseEdge.To);
 }