示例#1
0
        public override void Delete(ref TransactionFramework.TransactionChain chain)
        {
            MapManager.NodeFactory.DeleteNode(this);

            TransactionFramework.DeleteNodeTransactionLink deleteNode = new TransactionFramework.DeleteNodeTransactionLink();
            deleteNode.DomainId   = DomainId;
            deleteNode.MapManager = MapManager;
            deleteNode.Node       = this;

            chain.AddTransaction(deleteNode);
        }
示例#2
0
        public override void Delete(ref TransactionFramework.TransactionChain chain)
        {
            MapManager.RelationshipFactory.DeleteRelationship(this);

            TransactionFramework.DeleteRelationshipTransactionLink deleteRelationship = new TransactionFramework.DeleteRelationshipTransactionLink();
            deleteRelationship.DomainId     = DomainId;
            deleteRelationship.MapManager   = MapManager;
            deleteRelationship.Relationship = this;

            chain.AddTransaction(deleteRelationship);
        }
示例#3
0
        public IRelationship CreateRelationship(Guid domainId, Guid rootMapId, RelationshipType relationshipType, string originalId, ref TransactionFramework.TransactionChain chain)
        {
            TransactionFramework.AddRelationshipTransactionLink createRelationshipTransaction = new TransactionFramework.AddRelationshipTransactionLink();
            createRelationshipTransaction.MapManager       = this;
            createRelationshipTransaction.DomainId         = domainId;
            createRelationshipTransaction.RootMapId        = rootMapId;
            createRelationshipTransaction.RelationshipType = relationshipType;
            createRelationshipTransaction.OriginalId       = originalId;

            chain.AddTransaction(createRelationshipTransaction);

            IRelationship relationship = createRelationshipTransaction.CreateInProcessObjects();

            return(relationship);
        }
示例#4
0
        public INode CreateNode(Guid domainId, Guid rootMapId, NodeType nodeType, string originalId, ref TransactionFramework.TransactionChain chain)
        {
            TransactionFramework.AddNodeTransactionLink createNodeTransaction = new TransactionFramework.AddNodeTransactionLink();
            createNodeTransaction.MapManager = this;
            createNodeTransaction.DomainId   = domainId;
            createNodeTransaction.RootMapId  = rootMapId;
            createNodeTransaction.NodeType   = nodeType;
            createNodeTransaction.OriginalId = originalId;

            chain.AddTransaction(createNodeTransaction);

            INode node = createNodeTransaction.CreateInProcessObjects();

            return(node);
        }
示例#5
0
        public override void Update(NodeType nodeType, ref TransactionFramework.TransactionChain chain)
        {
            NodeType = nodeType;

            if (LastUpdateNode != null && LastUpdateNode.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient)
            {
                LastUpdateNode.NodeType = nodeType;
            }
            else
            {
                LastUpdateNode = CreateNewUpdateNode(nodeType);
                chain.AddTransaction(LastUpdateNode);
            }

            chain.TransactionExecuting += OnTransactionExecuting;
        }
示例#6
0
        public override void Update(RelationshipType relationshipType, ref TransactionFramework.TransactionChain chain)
        {
            RelationshipType = relationshipType;

            if (LastUpdateRelationship != null && LastUpdateRelationship.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient)
            {
                LastUpdateRelationship.RelationshipType = relationshipType;
            }
            else
            {
                LastUpdateRelationship = CreateNewUpdateRelationship();
                LastUpdateRelationship.RelationshipType = relationshipType;
                chain.AddTransaction(LastUpdateRelationship);
            }

            chain.TransactionExecuting += OnTransactionExecuting;
        }
示例#7
0
        public override void ConnectNode(ConnectionType connectionType, INode node, ref TransactionFramework.TransactionChain chain)
        {
            base.ConnectNode(connectionType, node, ref chain);

            if (LastUpdateRelationship != null && LastUpdateRelationship.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient)
            {
                LastUpdateRelationship.AddNode(connectionType, node);
            }
            else
            {
                LastUpdateRelationship = CreateNewUpdateRelationship();
                LastUpdateRelationship.AddNode(connectionType, node);
                chain.AddTransaction(LastUpdateRelationship);
            }

            chain.TransactionExecuting += OnTransactionExecuting;
        }
示例#8
0
        public override void Update(string name, string value, INode node, IRelationship relationship, ConnectionType connectionType, ref TransactionFramework.TransactionChain chain)
        {
            base.Update(name, value, node, relationship, connectionType, ref chain);

            TransactionFramework.UpdateMetadataTransactionLink updateMetadataTransaction = new TransactionFramework.UpdateMetadataTransactionLink();

            if (Node != null)
            {
                updateMetadataTransaction.DomainId = Node.DomainId;
            }
            else if (Relationship != null)
            {
                updateMetadataTransaction.DomainId = Relationship.DomainId;
            }

            updateMetadataTransaction.MapManager = MapManager;
            updateMetadataTransaction.Metadata   = this;
            updateMetadataTransaction.Name       = name;
            updateMetadataTransaction.Value      = value;

            chain.AddTransaction(updateMetadataTransaction);
        }
示例#9
0
        public override void Delete(ref TransactionFramework.TransactionChain chain)
        {
            base.Delete(ref chain);

            TransactionFramework.DeleteMetadataTransactionLink deleteMetadataTransction = new TransactionFramework.DeleteMetadataTransactionLink();

            if (Node != null)
            {
                deleteMetadataTransction.DomainId = Node.DomainId;
            }
            else if (Relationship != null)
            {
                deleteMetadataTransction.DomainId = Relationship.DomainId;
            }

            deleteMetadataTransction.MapManager = MapManager;
            deleteMetadataTransction.Metadata   = this;

            chain.AddTransaction(deleteMetadataTransction);

            /// TODO: Need to consider whether the following should be done here. It was originally done in the base but this really shouldn't happen for an InProcessMetadata as when add transaction
            /// returns (for the InProcessMetadata transaction link) the delete transaction still needs to occur.
            MetadataSetFactory.GetInstance(MapManager).Remove(this);
        }