Exemplo n.º 1
0
    static string MapFilePath(M.Database db)
    {
        M.PropertySet dbConnProps = App.CreatePropertySetParse(db.Connection);
        string        path        = dbConnProps.GetProperty("Source");

        return(path);
    }
Exemplo n.º 2
0
    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);
    }
Exemplo n.º 3
0
    private static List <string> PropertyItems(M.PropertySet propSet)
    {
        List <string> ps = new List <string>();

        foreach (M.Property p in propSet)
        {
            ps.Add(PropertyItem(p.Name, p.Data));
        }
        return(ps);
    }