Esempio n. 1
0
    public override Object Clone()
    {
        CollectionLiteralExpImpl theClone = (CollectionLiteralExpImpl)base.Clone();

        theClone.kind = kind;

        if (parts != null)
        {
            theClone.parts = new List <CollectionLiteralPart>(parts.Cast <CollectionLiteralPartImpl>().ToList().Clone());

            foreach (CollectionLiteralPartImpl part in theClone.parts)
            {
                part.setLiteralExp(theClone);
            }
        }
        return(theClone);
    }
Esempio n. 2
0
        public CollectionLiteralExp createCollectionLiteralExp(
            List <object> parts,
            CollectionType type)
        {
            CollectionLiteralExp exp = new CollectionLiteralExpImpl();

            exp.setFactory(this);

            exp.setKind(((CollectionTypeImpl)type).getCollectionKind());
            exp.setType(type);
            if (parts != null)
            {
                foreach (CollectionLiteralPartImpl part in parts)
                {
                    ((CollectionLiteralExpImpl)exp).addPart(part);
                    part.setLiteralExp(exp);
                }
            }
            return(exp);
        }