Thinktecture.Tools.Web.Services.CodeGeneration.ElementStore.SetupRelations C# (CSharp) Method

SetupRelations() public method

public SetupRelations ( Rpc2DocumentLiteralTranslator trans ) : void
trans Rpc2DocumentLiteralTranslator
return void
        public void SetupRelations(Rpc2DocumentLiteralTranslator trans)
        {
            foreach(R2DBinding s in bindings.Values)
            {
                s.SetupRelations(this, trans);
            }
            foreach(R2DPortType s in portTypes.Values)
            {
                s.SetupRelations(this, trans);
            }
            foreach(R2DOperation s in operations.Values)
            {
                s.SetupRelations(this, trans);
            }
            foreach(R2DMessage s in inputMessages.Values)
            {
                s.SetupRelations(this, trans);
            }
            foreach(R2DMessage s in outputMessages.Values)
            {
                s.SetupRelations(this, trans);
            }
        }

Usage Example

        private bool BuildItems(XmlNamespaceManager nsmgr)
        {
            XmlNodeList list = GetAffectedBindings();

            if (list == null)
            {
                return(false);
            }
            else
            {
                foreach (XmlElement n in list)
                {
                    store.Bindings.Add(n.Attributes["name"].Value, new R2DBinding(n, nsmgr));
                }
            }
            list = GetAffectedPortTypes();
            if (list != null)
            {
                foreach (XmlElement n in  list)
                {
                    store.PortTypes.Add(n.Attributes["name"].Value, new R2DPortType(n, nsmgr));
                }
            }
            list = GetAffectedOperations();
            if (list != null)
            {
                foreach (XmlElement n in  list)
                {
                    store.Operations.Add(n.Attributes["name"].Value, new R2DOperation(n, nsmgr));
                }
            }
            list = GetAffectedInputMessages();
            if (list != null)
            {
                foreach (XmlElement n in  list)
                {
                    store.InputMessages.Add(n.Attributes["name"].Value, new R2DMessage(n, nsmgr));
                }
            }
            list = GetAffectedOutputMessages();
            if (list != null)
            {
                foreach (XmlElement n in  list)
                {
                    store.OutputMessages.Add(n.Attributes["name"].Value, new R2DMessage(n, nsmgr));
                }
            }
            list = GetAffectedInputTypes();
            if (list != null)
            {
                foreach (XmlElement n in  list)
                {
                    string typeNameAttributeName = "type";
                    if (n.Attributes["element"] != null)
                    {
                        typeNameAttributeName = "element";
                    }
                    try
                    {
                        store.Types.Add(n.ParentNode.Attributes["name"].Value + "/" + n.Attributes[typeNameAttributeName].Value, new R2DType(n, n.Attributes[typeNameAttributeName].Value, nsmgr));
                    }
                    catch (ArgumentException)
                    {
                        // that's fine
                    }
                }
            }
            list = GetAffectedOutputTypes();
            if (list != null)
            {
                foreach (XmlElement n in  list)
                {
                    string typeNameAttributeName = "type";
                    if (n.Attributes["element"] != null)
                    {
                        typeNameAttributeName = "element";
                    }
                    try
                    {
                        store.Types.Add(n.ParentNode.Attributes["name"].Value + "/" + n.Attributes[typeNameAttributeName].Value, new R2DType(n, n.Attributes[typeNameAttributeName].Value, nsmgr));
                    }
                    catch (ArgumentException)
                    {
                        // that's fine
                    }
                }
            }
            store.SetupRelations(this);
            return(true);
        }