示例#1
0
 public void FromXml(XElement element, IFromXmlContext ctx)
 {
     DisplayName   = element.Attribute("DisplayName").Value;
     Query         = ctx.GetQuery(element.Attribute("Query").Value);
     EntityType    = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value));
     HideQuickLink = element.Attribute("HideQuickLink")?.Let(a => bool.Parse(a.Value)) ?? false;
     Owner         = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value)) !;
     Filters.Synchronize(element.Element("Filters")?.Elements().ToList(), (f, x) => f.FromXml(x, ctx));
     Columns.Synchronize(element.Element("Columns")?.Elements().ToList(), (c, x) => c.FromXml(x, ctx));
     Parameters.Synchronize(element.Element("Parameters")?.Elements().ToList(), (p, x) => p.FromXml(x, ctx));
     ChartScript = ctx.ChartScript(element.Attribute("ChartScript").Value);
     ParseData(ctx.GetQueryDescription(Query));
 }
示例#2
0
 public void FromXml(XElement element, IFromXmlContext ctx)
 {
     DisplayName = element.Attribute("DisplayName").Value;
     Query = ctx.GetQuery(element.Attribute("Query").Value);
     EntityType = element.Attribute("EntityType")?.Let(a => ctx.GetType(a.Value));
     Owner = element.Attribute("Owner")?.Let(a => Lite.Parse(a.Value));
     ChartScript = ctx.ChartScript(element.Attribute("ChartScript").Value);
     GroupResults = bool.Parse(element.Attribute("GroupResults").Value);
     Filters.Synchronize((element.Element("Filters")?.Elements()).EmptyIfNull().ToList(), (f, x) => f.FromXml(x, ctx));
     Columns.Synchronize((element.Element("Columns")?.Elements()).EmptyIfNull().ToList(), (c, x) => c.FromXml(x, ctx));
     Orders.Synchronize((element.Element("Orders")?.Elements()).EmptyIfNull().ToList(), (o, x) => o.FromXml(x, ctx));
     Parameters.Synchronize((element.Element("Parameters")?.Elements()).EmptyIfNull().ToList(), (p, x) => p.FromXml(x, ctx));
     ParseData(ctx.GetQueryDescription(Query));
 }