Exemplo n.º 1
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserQuery",
                         new XAttribute("Guid", Guid),
                         new XAttribute("DisplayName", DisplayName),
                         new XAttribute("Query", Query.Key),
                         EntityType == null ? null ! : new XAttribute("EntityType", ctx.TypeToName(EntityType)),
                         Owner == null ? null ! : new XAttribute("Owner", Owner.Key()),
                         !HideQuickLink ? null ! : new XAttribute("HideQuickLink", HideQuickLink),
                         IncludeDefaultFilters == null ? null ! : new XAttribute("IncludeDefaultFilters", IncludeDefaultFilters.Value),
                         !AppendFilters ? null ! : new XAttribute("AppendFilters", AppendFilters),
                         RefreshMode == RefreshMode.Auto ? null ! : new XAttribute("RefreshMode", RefreshMode.ToString()),
                         !GroupResults ? null ! : new XAttribute("GroupResults", GroupResults),
                         ElementsPerPage == null ? null ! : new XAttribute("ElementsPerPage", ElementsPerPage),
                         PaginationMode == null ? null ! : new XAttribute("PaginationMode", PaginationMode),
                         new XAttribute("ColumnsMode", ColumnsMode),
                         Filters.IsNullOrEmpty() ? null ! : new XElement("Filters", Filters.Select(f => f.ToXml(ctx)).ToList()),
                         Columns.IsNullOrEmpty() ? null ! : new XElement("Columns", Columns.Select(c => c.ToXml(ctx)).ToList()),
                         Orders.IsNullOrEmpty() ? null ! : new XElement("Orders", Orders.Select(o => o.ToXml(ctx)).ToList())));
 }