Beispiel #1
0
        public VertexBase(IStore _Store)
        {
            UsageCounter = 0;

            _store       = _Store;
            _AccessLevel = GeneralUtil.CreateAndCopyList <AccessLevelEnum>(_store.AccessLevel);
        }
Beispiel #2
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);
        }
Beispiel #3
0
        static public void RemoveAllEdges(IVertex v)
        {
            IList <IEdge> el = GeneralUtil.CreateAndCopyList <IEdge>(v);

            foreach (IEdge e in el)
            {
                v.DeleteEdge(e);
            }
        }
Beispiel #4
0
        private void EdgeRemoved(VertexChangeEventArgs e)
        {
            IList l = GeneralUtil.CreateAndCopyList(Items);

            foreach (TreeVisualiserViewItem i in l)
            {
                if (((IEdge)i.Tag) == e.Edge)
                {
                    Items.Remove(i);
                }
            }
        }
Beispiel #5
0
        public StoreBase(string identifier, IStoreUniverse storeUniverse, AccessLevelEnum[] accessLeveList)
        {
            _Identifier = identifier;

            _StoreUniverse = storeUniverse;

            VertexIdentifiersDictionary = new Dictionary <string, IVertex>();

            _AcessLevel = GeneralUtil.CreateAndCopyList <AccessLevelEnum>(accessLeveList);

            storeUniverse.Stores.Add(this);
        }
Beispiel #6
0
        public static void DeleteAllEdges(IVertex toVertex)
        {
            IList <IEdge> elist = GeneralUtil.CreateAndCopyList <IEdge>(toVertex.OutEdges);

            foreach (IEdge e in elist)
            {
                e.From.DeleteEdge(e);
            }

            elist = GeneralUtil.CreateAndCopyList <IEdge>(toVertex.InEdges);

            foreach (IEdge e in elist)
            {
                e.From.DeleteEdge(e);
            }
        }
Beispiel #7
0
        public FileSystemStore(string identifier, IStoreUniverse storeUniverse, AccessLevelEnum[] accessLeveList)
        {
            _Identifier = identifier;

            _StoreUniverse = storeUniverse;

            _AcessLevel = GeneralUtil.CreateAndCopyList <AccessLevelEnum>(accessLeveList);

            storeUniverse.Stores.Add(this);

            _Root = new DirectoryVertex(identifier, this);

            String rvv = (String)_Root.Value;

            if (rvv[rvv.Length - 1] == '\\') // problems with queries where vertex value has last character =="\\"
            {
                _Root.Value = rvv.Substring(0, rvv.Length - 1);
            }
        }