private void BuildSubjectCatalog(xbase.ObjCatelog catalog, SubjectSchema subjectSchema) { catalog.Id = subjectSchema.Id; catalog.Title = subjectSchema.Title; catalog.Description = subjectSchema.Description; catalog.ObjType = typeof(Subject).Name; for (int i = 0; i < subjectSchema.ChildSubjects.Count; i++) { xbase.ObjCatelog childCate = new xbase.ObjCatelog(); childCate.Path = catalog.Path + PathChar + subjectSchema.ChildSubjects[i].Id; catalog.Children.Add(childCate); BuildSubjectCatalog(childCate, subjectSchema.ChildSubjects[i]); } }
public xbase.ObjCatelog GetCatalog() { xbase.ObjCatelog ret = new xbase.ObjCatelog(); ret.Id = schema.Id; ret.Title = schema.Title; ret.Description = schema.Description; ret.ObjType = this.GetType().Name; ret.Path = PathChar + ""; for (int i = 0; i < schema.Subjects.Count; i++) { xbase.ObjCatelog subjectCata = new xbase.ObjCatelog(); subjectCata.Path = PathChar + schema.Subjects[i].Id; ret.Children.Add(subjectCata); BuildSubjectCatalog(subjectCata, schema.Subjects[i]); } return(ret); }