Exemple #1
0
        private void OnTransactionCompleted(object sender, Service.CompleteTransactionCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                foreach (Service.CH change in e.Result.C)
                {
                    if (change.P == ResponseParameter.I)
                    {
                        if (change.M != null)
                        {
                            DebugLogger.Instance.LogMsg("Load metadata transaction completed. ResponseParameter Id - '{0}'; Name - '{1}'; Value - '{2}'; Returned MetadataId - '{3}'", ResponseParameter.I, Name, Value, change.M.M);
                            ServerObjects.Metadata soMetadata = MapManager.ServerObjectConverter.ToMetadata(change.M);
                            MetadataSetFactory.GetInstance(MapManager).UpgradeFacade(this, soMetadata);
                        }
                    }
                }
            }

            if (InternalTransactionCompleted != null)
            {
                InternalTransactionCompleted(this, e);
            }
        }
        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);
        }