示例#1
0
        public void Attach()
        {
            if (DetachState != DetachStateEnum.Detached)
            {
                throw new Exception("Edge not in Detached state");
            }

            // to

            IStore store = From.Store.StoreUniverse.GetStore(ToStoreTypeName, ToStoreIdentifier);

            if (store == null)
            {
                throw new Exception(ToStoreIdentifier + " store not found");
            }

            _to = store.GetVertexByIdentifier(ToIdentifier);

            To.AddInEdge(this);

            // meta

            store = From.Store.StoreUniverse.GetStore(MetaStoreTypeName, MetaStoreIdentifier);

            if (store == null)
            {
                throw new Exception(MetaStoreIdentifier + " store not found");
            }

            _meta = store.GetVertexByIdentifier(MetaIdentifier);


            _detachState = DetachStateEnum.Attached;
        }
示例#2
0
        public void Detach()
        {
            ToStoreIdentifier = To.Store.Identifier;

            ToStoreTypeName = To.Store.TypeName;

            ToIdentifier = To.Identifier;

            To.DeleteInEdge(this);

            _to = null;

            if (Meta != null)
            {
                MetaStoreIdentifier = Meta.Store.Identifier;

                MetaStoreTypeName = Meta.Store.TypeName;

                MetaIdentifier = Meta.Identifier;
            }

            _meta = null;

            _detachState = DetachStateEnum.Detached;
        }