Ejemplo n.º 1
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("CombinedUserChartPart",
                         new XAttribute("ShowData", ShowData),
                         new XAttribute("AllowChangeShowData", AllowChangeShowData),
                         new XAttribute("CombinePinnedFiltersWithSameLabel", CombinePinnedFiltersWithSameLabel),
                         new XAttribute("UseSameScale", UseSameScale),
                         UserCharts.Select(uc => new XElement("UserChart", new XAttribute("Guid", ctx.Include(uc))))));
 }
Ejemplo n.º 2
0
        public void FromXml(XElement element, IFromXmlContext ctx)
        {
            var newUserCharts = element.Elements("UserChart").Select(uc => (UserChartEntity)ctx.GetEntity(Guid.Parse(uc.Attribute("Guid") !.Value))).ToList();

            ShowData            = element.Attribute("ShowData")?.Value.ToBool() ?? false;
            AllowChangeShowData = element.Attribute("AllowChangeShowData")?.Value.ToBool() ?? false;
            CombinePinnedFiltersWithSameLabel = element.Attribute("CombinePinnedFiltersWithSameLabel")?.Value.ToBool() ?? false;
            UseSameScale = element.Attribute("UseSameScale")?.Value.ToBool() ?? false;
            UserCharts.Synchronize(newUserCharts);
        }
Ejemplo n.º 3
0
 public void FromXml(XElement element, IFromXmlContext ctx)
 {
     ShowData            = element.Attribute(nameof(ShowData))?.Value.ToBool() ?? false;
     AllowChangeShowData = element.Attribute(nameof(AllowChangeShowData))?.Value.ToBool() ?? false;
     CombinePinnedFiltersWithSameLabel = element.Attribute(nameof(CombinePinnedFiltersWithSameLabel))?.Value.ToBool() ?? false;
     UseSameScale = element.Attribute(nameof(UseSameScale))?.Value.ToBool() ?? false;
     UserCharts.Synchronize(element.Elements("UserChart").ToList(), (cuce, elem) =>
     {
         cuce.UserChart     = (UserChartEntity)ctx.GetEntity(Guid.Parse(elem.Attribute("Guid") !.Value));
         cuce.IsQueryCached = elem.Attribute(nameof(cuce.IsQueryCached))?.Value.ToBool() ?? false;
     });
Ejemplo n.º 4
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("CombinedUserChartPart",
                         ShowData ? new XAttribute(nameof(ShowData), ShowData) : null,
                         AllowChangeShowData ? new XAttribute(nameof(AllowChangeShowData), AllowChangeShowData) : null,
                         CombinePinnedFiltersWithSameLabel ? new XAttribute(nameof(CombinePinnedFiltersWithSameLabel), CombinePinnedFiltersWithSameLabel) : null,
                         UseSameScale ? new XAttribute(nameof(UseSameScale), UseSameScale) : null,
                         UserCharts.Select(uc => new XElement("UserChart",
                                                              new XAttribute("Guid", ctx.Include(uc.UserChart)),
                                                              uc.IsQueryCached ? new XAttribute(nameof(uc.IsQueryCached), uc.IsQueryCached) : null))
                         ));
 }
Ejemplo n.º 5
0
 public override string ToString()
 {
     return(UserCharts.ToString(", "));
 }