public ArrayCreationExpression(TypeToken type, IEnumerable <Expression> sizes, IEnumerable <Expression> inits,
                                TextSpan textSpan, FileNode fileNode)
     : base(textSpan, fileNode)
 {
     Type         = type;
     Sizes        = sizes as List <Expression> ?? Sizes?.ToList();
     Initializers = inits as List <Expression> ?? inits?.ToList();
 }
Beispiel #2
0
        public SelectList SizeSelect(int?sizeId, bool withNoneOption = false)
        {
            var items = Sizes.ToList();

            if (withNoneOption)
            {
                items.Insert(0, new SelectListItem()
                {
                    Value = "0", Text = "- has no size -"
                });
            }
            return(new SelectList(items, "Value", "Text", sizeId));
        }