static string CreateStatementBody(M.Database db, string name) { List <string> items = new List <string>(); string type = db.GetComponentType(name).ToUpper(); if (type == "TABLE") { using (M.Table table = db.Search(name)) { M.Schema schema = table.GetSchema(); items.AddRange(FieldItems(schema.Fields)); items.AddRange(IndexItems(schema.Indexes)); items.AddRange(ConstraintItems(schema.Constraints)); } } M.PropertySet propertySet = db.GetProperties(name); items.AddRange(PropertyItems(propertySet)); string body = String.Join("," + Environment.NewLine, items.Select(i => String.Concat(Indent, i))); return(body); }
static List <string> Names(M.Database db) { List <string> names = new List <string>(); using (M.Table root = db.Search("mfd_root")) { using (M.Sequence sequence = root.SearchAll(new string[] { "name" })) { while (sequence.Fetch()) { names.Add(sequence.GetValues()[0].Data.ToString()); } } } names.Sort(); return(names); }
static List <string> CompNames(M.Database db) { var names = new List <string>(); using (M.Table t = db.Search("mfd_root")) { using (M.Sequence sequence = t.SearchAll(new string[] { "mfd_id", "type", "name" })) { while (sequence.Fetch()) { names.Add( sequence.GetValues()[1].Data.ToString() + " " + "[" + sequence.GetValues()[2].Data.ToString() + "]" + " " + sequence.GetValues()[0].Data.ToString() ); } } } names.Sort(); return(names); }