コード例 #1
0
ファイル: SoapTypeManager.cs プロジェクト: chris-tomich/Glyma
        public void AddConnectionTypes(IEnumerable <Service.DT> serviceDescriptorTypes)
        {
            foreach (Service.DT serviceDescriptorType in serviceDescriptorTypes)
            {
                Proxy.ConnectionType proxyConnectionType = new Proxy.ConnectionType();
                proxyConnectionType.LoadTypeInfo(serviceDescriptorType);

                ConnectionTypes.Add(serviceDescriptorType, proxyConnectionType);
            }
        }
コード例 #2
0
        public Proxy.IMetadataSet Add(Proxy.IRelationship relationship, Proxy.ConnectionType connectionType, string name, string value, ref TransactionFramework.TransactionChain chain)
        {
            Proxy.IMetadataSet newMetadataSet = ParentNode.Proxy.Metadata.Add(relationship, connectionType, name, value, ref chain);

            if (!Metadata.ContainsKey(name))
            {
                IMetadata newMetadata = ParentNode.ViewModelMetadataFactory.CreateMetadata(newMetadataSet);

                Add(name, newMetadata);
                return(newMetadata.MetadataSet);
            }
            return(newMetadataSet);
        }
コード例 #3
0
        public bool LoadRelationship(SoapNodeManager nodeManager)
        {
            Metadata.Clear();
            Proxy.INodeManager nodeSetManager = Nodes;
            nodeSetManager.Clear();

            foreach (KeyValuePair <ServerObjects.MetadataContext, ServerObjects.Metadata> metadataPair in ServiceRelationship.Metadata)
            {
                if (metadataPair.Value.NodeUid.HasValue)
                {
                    Proxy.INode node = nodeManager.FindNode(metadataPair.Value.NodeUid.Value);
                    Metadata.Load(metadataPair.Value, node);
                }
                else if (metadataPair.Value.RelationshipUid.HasValue)
                {
                    Metadata.Load(metadataPair.Value, null);
                }
            }

            foreach (KeyValuePair <Guid, Guid> relationship in ServiceRelationship.Nodes)
            {
                Guid descriptorTypeId = relationship.Key;
                Guid nodeId           = relationship.Value;

                // TODO: There needs to be a proper check for the ConnectionType that will perform an appropriate operation if none exists.
                if (MapManager.ConnectionTypes.ContainsKey(descriptorTypeId))
                {
                    Proxy.INode          node;
                    Proxy.ConnectionType connectionType = MapManager.ConnectionTypes[descriptorTypeId];

                    node = nodeManager.FindNode(nodeId);

                    Proxy.ConnectionSet connectionSet = Proxy.ConnectionSetFactory.Instance.GetConnection(node, this, connectionType);

                    if (node.Status != Proxy.LoadState.None)
                    {
                        Proxy.IRelationshipManager relationshipSetManager = node.Relationships;

                        relationshipSetManager.Load(connectionSet);
                    }

                    nodeSetManager.Load(connectionSet);
                }
            }

            Status = Proxy.LoadState.Full;

            ProcessDelayedActions();

            return(true);
        }
コード例 #4
0
        public override void ConnectNode(Proxy.ConnectionType connectionType, Proxy.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;
        }
コード例 #5
0
        public override void ConnectNode(Proxy.ConnectionType connectionType, Proxy.INode node, ref Soap.TransactionFramework.TransactionChain chain)
        {
            base.ConnectNode(connectionType, node, ref chain);

            if (Facade != null)
            {
                TransactionFramework.AddRelationshipTransactionLink addRelationshipTransaction = Facade.TransactionOrigin as TransactionFramework.AddRelationshipTransactionLink;

                if (addRelationshipTransaction != null)
                {
                    if (addRelationshipTransaction.TransactionStatus == TransactionFramework.ServerStatus.ProcessingClient)
                    {
                        addRelationshipTransaction.AddNode(connectionType, node);

                        return;
                    }
                }
            }

            DelayedActions.Enqueue(new DelayedRelationshipAction()
            {
                Action = Proxy.TransactionActionType.Updated, ConnectionType = connectionType, Node = node
            });
        }