MetadataClassSchema GetMetaCompositAcronim(MetadataClassSchema mc, string Acronym) { MetaField mf = mc.MetaFields.Where(x => x.Akronim == Acronym).FirstOrDefault(); if (mf == null) Error(string.Format("metaSchema <{0}>: metaField <{1}> not found.", mc.Cl_Id, Acronym)); else return GetMetaSchema(mf.CompositAttrAkronim); return null; }
void fill_metadata(List<Metadata> list, int offs, MetadataClassSchema mc) { ulong pos = map.Position; obj2.Get(offs); offs = obj2.Offset; xmap.IAttrs hf = obj2.hf; int n = hf.Count; for (int i = 0; i < n; i++) { string key, str; double v1, v2; int op; hf.GetValue(i, out key, out str, out v1, out v2, out op); if (convert.IsString(key)) if (convert.IsString(str)) { Metadata m = metadata(key, mc.Cl_Id); m.IsCompositeAttribute = false; MetaValue v = new MetaValue(); v.Value = str; m.Values = new List<MetaValue>(); m.Values.Add(v); list.Add(m); } } if (map.get_Seek_Node(offs, "") > 0) if (map.Goto_down > 0) do { obj2.Get(0); int loc = obj2.Loc; if (loc == 30) { string key = obj2.acronym; if (convert.IsString(key)) { Metadata m = metadata(key, mc.Cl_Id); m.IsCompositeAttribute = true; m.CompositeMetadata = new List<Metadata>(); MetadataClassSchema mc1 = GetMetaCompositAcronim(mc, key); if (mc1 != null) fill_metadata(m.CompositeMetadata, obj2.Offset, mc1); list.Add(m); } } } while (map.Goto_right > 0); map.Position = pos; }