Esempio n. 1
0
        public RegionImpl(RegionImplXml regionImpl)
        {
            Name           = regionImpl.Name;
            GroupOverloads = regionImpl.GroupOverloads;

            var elements = new List <IElementImpl>();

            foreach (var element in regionImpl.Elements)
            {
                if (element is RegionImplXml)
                {
                    elements.Add(new RegionImpl((RegionImplXml)element));
                }
                else if (element is MethodImplXml)
                {
                    elements.Add(new MethodImpl((MethodImplXml)element));
                }
                else if (element is InlineMethodDefXml)
                {
                    elements.Add(new InlineMethodDef((InlineMethodDefXml)element));
                }
                else
                {
                    throw new NotImplementedException($"Don't know how to handle XML object of type '{element.GetType()}'.");
                }
            }

            Elements = elements.ToReadOnlyList();
        }
Esempio n. 2
0
 public RegionImpl(RegionImplXml regionImpl)
 {
     Name             = regionImpl.Name;
     GroupOverloads   = regionImpl.GroupOverloads;
     Regions          = regionImpl.Regions.Select(r => new RegionImpl(r)).ToReadOnlyList();
     MethodImpls      = regionImpl.MethodImpls.Select(m => new MethodImpl(m)).ToReadOnlyList();
     InlineMethodDefs = regionImpl.InlineMethodDefs.Select(m => new InlineMethodDef(m)).ToReadOnlyList();
 }