public List <ObjectMDM> GetAllObjects() { if (InnerObjects == null) { return(null); } var resObjs = InnerObjects.ToList(); foreach (var item in InnerObjects) { var innerObjs = item.GetAllObjects(); if (innerObjs != null) { resObjs.AddRange(innerObjs); } } return(resObjs); }
public override void PreConvert() { //add implicit converter foreach (var io in InnerObjects.ToList().Concat(EnumeratedTypes.ToList())) { new Method(this, "", AccessSpecifier.Public, new ImplicitType(null, Name), true, new List <MethodParameter>() { new MethodParameter(null, io.UnderlyingType, "value") }) { Body = $"{{ return new {Name}(value); }}" }; } new Method(this, Name, AccessSpecifier.Public, null, false, new List <MethodParameter>() { new MethodParameter(null, new Type(this, "object"), "value") }) { Body = $"{{ Value = value; }}" }; Extends.Add(new Type(null, "Enumerated")); }