예제 #1
0
        private string generateRelationship(FCOConnection dst)
        {
            FCO           current = dst.Fco;
            string        relname = dst.Conn.className;
            StringBuilder inner   = new StringBuilder();

            inner.AppendFormat(FCO.Template.RelationshipInner, current.className, current.ProperClassName, current.memberType);
            if (current.HasChildren)
            {
                //and add all of the children
                foreach (DerivedWithKind child in current.ChildrenRecursive)
                {
                    if (child.Type == DerivedWithKind.InhType.General ||
                        child.Type == DerivedWithKind.InhType.Interface)
                    {
                        inner.AppendFormat(FCO.Template.RelationshipInner, child.Rel.className, child.Rel.ProperClassName, child.Rel.memberType);
                    }
                }
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(FCO.Template.Relationship, current.className, relname, inner.ToString(), dst.DstOrSrc, dst.RoleName);

            return(sb.ToString());
        }
예제 #2
0
        private string generateReference(FCO current)
        {
            StringBuilder inner = new StringBuilder();

            //FCO current = Object.ElementsByName[typename] as FCO;

            inner.AppendFormat(Reference.Template.ReferenceInner, current.className, current.ProperClassName, current.memberType);
            if (current.HasChildren)
            {
                //and add all of the children
                foreach (DerivedWithKind child in current.ChildrenRecursive)
                {
                    if (child.Type == DerivedWithKind.InhType.General ||
                        child.Type == DerivedWithKind.InhType.Interface)
                    {
                        inner.AppendFormat(Reference.Template.ReferenceInner, child.Rel.className, child.Rel.ProperClassName, child.Rel.memberType);
                    }
                }
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(Reference.Template.Reference, current.className, inner.ToString());

            return(sb.ToString());
        }
예제 #3
0
        private void generateOwnContainerInnerModel(ref StringBuilder sb, ref List <string> modelNames)
        {
            //PossibleContainers that are models
            foreach (Object container in this.PossibleContainers)
            {
                FCO model = container as FCO;
                if (model != null)
                {
                    //this container is a model
                    if (!modelNames.Contains(model.className))
                    {
                        sb.AppendFormat(FCO.Template.ContainerModelInner, model.className, model.ProperClassName);
                        modelNames.Add(model.className);
                    }

                    //its children:
                    if (model.HasChildren)
                    {
                        //and add all of the children
                        foreach (DerivedWithKind child in model.ChildrenRecursive)
                        {
                            if (child.Type == DerivedWithKind.InhType.General ||
                                child.Type == DerivedWithKind.InhType.Interface)
                            {
                                if (!modelNames.Contains(child.Rel.className))
                                {
                                    sb.AppendFormat(FCO.Template.ContainerModelInner, child.Rel.className, child.Rel.ProperClassName);
                                    modelNames.Add(child.Rel.className);
                                }
                            }
                        }
                    }
                }
            }
        }
예제 #4
0
 public FCOConnection(FCO Fco, Connection Conn, string DstOrSrc, string RoleName)
 {
     this.Fco      = Fco;
     this.Conn     = Conn;
     this.DstOrSrc = DstOrSrc;
     this.RoleName = RoleName;
 }
예제 #5
0
        private string generateConnectionForInterface(FCO current)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(FCO.Template.ConnectionInterface, current.className);

            return(sb.ToString());
        }
예제 #6
0
        private string generateContainmentForInterface(FCO current)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(Model.Template.ContainmentInterface, current.className);

            return(sb.ToString());
        }
예제 #7
0
        private string generateMemberForInterface(FCO current)
        {
            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(Set.Template.SetMemberInterface, current.className);

            return(sb.ToString());
        }
예제 #8
0
        private string generateConnection(FCO current)
        {
            StringBuilder inner = new StringBuilder();

            inner.AppendFormat(FCO.Template.ConnectionInner, current.className, current.ProperClassName, "IMgaConnection");
            if (current.HasChildren)
            {
                //and add all of the children
                foreach (DerivedWithKind child in current.ChildrenRecursive)
                {
                    if (child.Type == DerivedWithKind.InhType.General ||
                        child.Type == DerivedWithKind.InhType.Interface)
                    {
                        inner.AppendFormat(FCO.Template.ConnectionInner, child.Rel.className, child.Rel.ProperClassName, "IMgaConnection");
                    }
                }
            }

            StringBuilder sb = new StringBuilder();

            sb.AppendFormat(FCO.Template.Connection, current.className, inner.ToString());

            return(sb.ToString());
        }
예제 #9
0
 public ConnEndPoints(FCO src, FCO dst)
 {
     this.src = src;
     this.dst = dst;
 }