Exemplo n.º 1
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserChartPart",
                         new XAttribute("ShowData", ShowData),
                         new XAttribute("AllowChangeShowData", AllowChangeShowData),
                         new XAttribute("UserChart", ctx.Include(UserChart))));
 }
Exemplo n.º 2
0
 internal XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("ValueUserQueryElement",
                         Label == null ? null : new XAttribute("Label", Label),
                         Href == null ? null : new XAttribute("Href", Href),
                         new XAttribute("UserQuery", ctx.Include(UserQuery))));
 }
Exemplo n.º 3
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserChartPart",
                         new XAttribute("ShowData", ShowData),
                         new XAttribute("AllowChangeShowData", AllowChangeShowData),
                         CreateNew ? new XAttribute("CreateNew", CreateNew) : null !,
                         AutoRefresh ? new XAttribute("AutoRefresh", AutoRefresh) : null !,
                         new XAttribute("UserChart", ctx.Include(UserChart))));
 }
Exemplo n.º 4
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserQueryPart",
                         new XAttribute("UserQuery", ctx.Include(UserQuery)),
                         new XAttribute("RenderMode", RenderMode.ToString()),
                         new XAttribute("AllowSelection", AllowSelection.ToString()),
                         new XAttribute("ShowFooter", ShowFooter.ToString())
                         ));
 }
Exemplo n.º 5
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserChartPart",
                         new XAttribute(nameof(UserChart), ctx.Include(UserChart)),
                         ShowData ? new XAttribute(nameof(ShowData), ShowData) : null,
                         AllowChangeShowData ? new XAttribute(nameof(AllowChangeShowData), AllowChangeShowData) : null,
                         IsQueryCached ? new XAttribute(nameof(IsQueryCached), IsQueryCached) : null,
                         CreateNew ? new XAttribute(nameof(CreateNew), CreateNew) : null !,
                         AutoRefresh ? new XAttribute(nameof(AutoRefresh), AutoRefresh) : null !
                         ));
 }
Exemplo n.º 6
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserQueryPart",
                         new XAttribute(nameof(UserQuery), ctx.Include(UserQuery)),
                         new XAttribute(nameof(RenderMode), RenderMode),
                         new XAttribute(nameof(AllowSelection), AllowSelection),
                         ShowFooter ? new XAttribute(nameof(ShowFooter), ShowFooter) : null,
                         CreateNew ? new XAttribute(nameof(CreateNew), CreateNew) : null,
                         IsQueryCached ? new XAttribute(nameof(IsQueryCached), IsQueryCached) : null
                         ));
 }
Exemplo n.º 7
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("JoyrideStep",
                         new XAttribute("Guid", Guid),
                         Culture == null ? null ! : new XElement("Culture", Culture.Key()),
                         new XElement("Title", Title),
                         Text == null ? null ! : new XElement("Text", Text),
                         Style == null ? null ! : new XElement("Style", ctx.Include(Style).ToString()),
                         new XElement("Selector", Selector),
                         new XElement("Position", Position.ToString()),
                         new XElement("Type", Type.ToString()),
                         new XElement("AllowClicksThruHole", AllowClicksThruHole),
                         new XElement("IsFixed", IsFixed)));
 }
Exemplo n.º 8
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return new XElement("UserQueryPart",
         new XAttribute("UserQuery", ctx.Include(UserQuery)));
 }
Exemplo n.º 9
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return new XElement("UserChartPart",
         new XAttribute("ShowData", ShowData),
         new XAttribute("UserChart", ctx.Include(UserChart)));
 }
Exemplo n.º 10
0
        public XElement ToXml(IToXmlContext ctx)
        {
            return(new XElement("Workflow",
                                new XAttribute("Guid", workflow.Guid),
                                new XAttribute("Name", workflow.Name),
                                new XAttribute("MainEntityType", ctx.TypeToName(workflow.MainEntityType.ToLite())),
                                new XAttribute("MainEntityStrategies", workflow.MainEntityStrategies.ToString(",")),
                                workflow.ExpirationDate == null ? null ! : new XAttribute("ExpirationDate", workflow.ExpirationDate.Value.ToString("o", CultureInfo.InvariantCulture)),

                                this.pools.Values.Select(p => new XElement("Pool",
                                                                           new XAttribute("BpmnElementId", p.BpmnElementId),
                                                                           new XAttribute("Name", p.Name),
                                                                           p.Xml.ToXml())),

                                this.lanes.Values.Select(la => new XElement("Lane",
                                                                            new XAttribute("BpmnElementId", la.BpmnElementId),
                                                                            new XAttribute("Name", la.Name),
                                                                            new XAttribute("Pool", la.Pool.BpmnElementId),
                                                                            la.Actors.IsEmpty() ? null ! : new XElement("Actors", la.Actors.Select(a => new XElement("Actor", a.KeyLong() !))),
                                                                            la.ActorsEval == null ? null ! : new XElement("ActorsEval", new XCData(la.ActorsEval.Script)),
                                                                            la.Xml.ToXml())),

                                this.activities.Values.Select(a => new XElement("Activity",
                                                                                new XAttribute("BpmnElementId", a.BpmnElementId),
                                                                                new XAttribute("Lane", a.Lane.BpmnElementId),
                                                                                new XAttribute("Name", a.Name),
                                                                                new XAttribute("Type", a.Type.ToString()),
                                                                                a.RequiresOpen == false ? null ! : new XAttribute("RequiresOpen", a.RequiresOpen),
                                                                                a.EstimatedDuration == null ? null ! : new XAttribute("EstimatedDuration", a.EstimatedDuration),
                                                                                string.IsNullOrEmpty(a.ViewName) ? null ! : new XAttribute("ViewName", a.ViewName),
                                                                                string.IsNullOrEmpty(a.Comments) ? null ! : new XElement("Comments", a.Comments),
                                                                                !a.ViewNameProps.Any() ? null ! : new XElement("ViewNameProps",
                                                                                                                               a.ViewNameProps.Select(vnp => new XElement("ViewNameProp", new XAttribute("Name", vnp.Name), new XCData(vnp.Expression !)))
                                                                                                                               ),
                                                                                !a.DecisionOptions.Any() ? null ! : new XElement("DecisionOptions",
                                                                                                                                 a.DecisionOptions.Select(cdo => cdo.ToXml("DecisionOption"))),
                                                                                a.CustomNextButton?.ToXml("CustomNextButton") !,
                                                                                string.IsNullOrEmpty(a.UserHelp) ? null ! : new XElement("UserHelp", new XCData(a.UserHelp)),
                                                                                a.SubWorkflow == null ? null ! : new XElement("SubWorkflow",
                                                                                                                              new XAttribute("Workflow", ctx.Include(a.SubWorkflow.Workflow)),
                                                                                                                              new XElement("SubEntitiesEval", new XCData(a.SubWorkflow.SubEntitiesEval.Script))
                                                                                                                              ),
                                                                                a.Script == null ? null ! : new XElement("Script",
                                                                                                                         new XAttribute("Script", ctx.Include(a.Script.Script)),
                                                                                                                         a.Script.RetryStrategy == null ? null ! : new XAttribute("RetryStrategy", ctx.Include(a.Script.RetryStrategy))
                                                                                                                         ),
                                                                                a.Xml.ToXml()
                                                                                )),

                                this.gateways.Values.Select(g => new XElement("Gateway",
                                                                              new XAttribute("BpmnElementId", g.BpmnElementId),
                                                                              g.Name.HasText() ? new XAttribute("Name", g.Name) : null !,
                                                                              new XAttribute("Lane", g.Lane.BpmnElementId),
                                                                              new XAttribute("Type", g.Type.ToString()),
                                                                              new XAttribute("Direction", g.Direction.ToString()),
                                                                              g.Xml.ToXml())),


                                this.events.Values.Select(e => new XElement("Event",
                                                                            new XAttribute("BpmnElementId", e.BpmnElementId),
                                                                            e.Name.HasText() ? new XAttribute("Name", e.Name) : null !,
                                                                            new XAttribute("Lane", e.Lane.BpmnElementId),
                                                                            new XAttribute("Type", e.Type.ToString()),
                                                                            e.Timer == null ? null ! : new XElement("Timer",
                                                                                                                    e.Timer.Duration?.ToXml("Duration") !,
                                                                                                                    e.Timer.Condition == null ? null ! : new XAttribute("Condition", ctx.Include(e.Timer.Condition))),
                                                                            e.BoundaryOf == null ? null ! : new XAttribute("BoundaryOf", this.activities.Values.SingleEx(a => a.Is(e.BoundaryOf)).BpmnElementId),
                                                                            e.Xml.ToXml())
                                                          ),

                                this.connections.Values.Select(c => new XElement("Connection",
                                                                                 new XAttribute("BpmnElementId", c.BpmnElementId),
                                                                                 c.Name.HasText() ? new XAttribute("Name", c.Name) : null !,
                                                                                 new XAttribute("Type", c.Type.ToString()),
                                                                                 new XAttribute("From", c.From.BpmnElementId),
                                                                                 new XAttribute("To", c.To.BpmnElementId),
                                                                                 c.DecisionOptionName == null ? null ! : new XAttribute("CustomDecisionName", c.DecisionOptionName !),
                                                                                 c.Condition == null ? null ! : new XAttribute("Condition", ctx.Include(c.Condition)),
                                                                                 c.Action == null ? null ! : new XAttribute("Action", ctx.Include(c.Action)),
                                                                                 c.Order == null ? null ! : new XAttribute("Order", c.Order),
                                                                                 c.Xml.ToXml()))
                                ));
        }
Exemplo n.º 11
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return new XElement("UserQueryPart",
         new XAttribute("UserQuery", ctx.Include(UserQuery)),
         new XAttribute("AllowSelection", AllowSelection.ToString()));
 }
Exemplo n.º 12
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))
                         ));
 }
Exemplo n.º 13
0
 internal XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("ToolbarElement",
                         new XAttribute("Type", Type),
                         string.IsNullOrEmpty(Label) ? null : new XAttribute("Label", Label),
                         string.IsNullOrEmpty(IconName) ? null : new XAttribute("IconName", IconName),
                         string.IsNullOrEmpty(IconColor) ? null :  new XAttribute("IconColor", IconColor),
                         OpenInPopup ? new XAttribute("OpenInPopup", OpenInPopup) : null,
                         AutoRefreshPeriod == null ? null : new XAttribute("AutoRefreshPeriod", AutoRefreshPeriod),
                         this.Content == null ? null : new XAttribute("Content",
                                                                      this.Content is Lite <QueryEntity>?ctx.QueryToName((Lite <QueryEntity>) this.Content) :
                                                                          this.Content is Lite <PermissionSymbol>?ctx.PermissionToName((Lite <PermissionSymbol>) this.Content) :
                                                                              (object)ctx.Include((Lite <IUserAssetEntity>) this.Content)),
                         string.IsNullOrEmpty(this.Url) ? null : new XAttribute("Url", this.Url)));
 }
Exemplo n.º 14
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserQueryPart",
                         new XAttribute("UserQuery", ctx.Include(UserQuery)),
                         new XAttribute("RenderMode", RenderMode.ToString())));
 }
Exemplo n.º 15
0
        public XElement ToXml(IToXmlContext ctx)
        {
            return(new XElement("Workflow",
                                new XAttribute("Guid", workflow.Guid),
                                new XAttribute("Name", workflow.Name),
                                new XAttribute("MainEntityType", ctx.TypeToName(workflow.MainEntityType.ToLite())),
                                new XAttribute("MainEntityStrategies", workflow.MainEntityStrategies.ToString(",")),
                                workflow.ExpirationDate == null ? null : new XAttribute("ExpirationDate", workflow.ExpirationDate.Value.ToString("o", CultureInfo.InvariantCulture)),
                                this.pools.Values.Select(p => new XElement("Pool",
                                                                           new XAttribute("BpmnElementId", p.BpmnElementId),
                                                                           new XAttribute("Name", p.Name),
                                                                           p.Xml.ToXCData())),

                                this.lanes.Values.Select(la => new XElement("Lane",
                                                                            new XAttribute("BpmnElementId", la.BpmnElementId),
                                                                            new XAttribute("Name", la.Name),
                                                                            new XAttribute("Pool", la.Pool.BpmnElementId),
                                                                            la.Actors.IsEmpty() ? null : new XElement("Actors", la.Actors.Select(a => new XElement("Actor", a.KeyLong()))),
                                                                            la.ActorsEval == null ? null : new XElement("ActorsEval", new XCData(la.ActorsEval.Script)),
                                                                            la.Xml.ToXCData())),

                                this.activities.Values.Select(a => new XElement("Activity",
                                                                                new XAttribute("BpmnElementId", a.BpmnElementId),
                                                                                new XAttribute("Lane", a.Lane.BpmnElementId),
                                                                                new XAttribute("Name", a.Name),
                                                                                a.Comments == null ? null : new XAttribute("Comments", a.Comments),
                                                                                a.RequiresOpen == false ? null : new XAttribute("RequiresOpen", a.RequiresOpen),
                                                                                a.EstimatedDuration == null ? null : new XAttribute("EstimatedDuration", a.EstimatedDuration),
                                                                                a.ViewName == null ? null : new XAttribute("ViewName", a.ViewName),
                                                                                !a.ViewNameProps.Any() ? null : new XElement("ViewNameProps", a.ViewNameProps
                                                                                                                             .Select(vnp => new XElement("ViewNameProp", new XAttribute("Name", vnp.Name), new XCData(vnp.Expression)))),
                                                                                a.UserHelp == null ? null : new XElement("UserHelp", new XCData(a.UserHelp)),
                                                                                a.SubWorkflow == null ? null : new XElement("SubWorkflow",
                                                                                                                            new XAttribute("Workflow", ctx.Include(a.SubWorkflow.Workflow)),
                                                                                                                            new XAttribute("SubEntitiesEval", new XCData(a.SubWorkflow.SubEntitiesEval.Script))
                                                                                                                            )
                                                                                ))


                                //TODO: Complete code

                                ));
        }
Exemplo n.º 16
0
 internal XElement ToXml(IToXmlContext ctx)
 {
     return new XElement("CountUserQueryElement",
         Label == null ? null : new XAttribute("Label", Label),
         Href == null ? null : new XAttribute("Href", Href),
         new XAttribute("UserQuery", ctx.Include(UserQuery)));
 }
Exemplo n.º 17
0
    public XElement ToXml(IToXmlContext ctx)
    {
        if (this.Attachments != null && this.Attachments.Count() > 0)
        {
            throw new NotImplementedException("Attachments are not yet exportable");
        }

        return(new XElement("EmailTemplate",
                            new XAttribute("Name", Name),
                            new XAttribute("Guid", Guid),
                            new XAttribute("DisableAuthorization", DisableAuthorization),
                            new XAttribute("Query", Query.Key),
                            new XAttribute("EditableMessage", EditableMessage),
                            Model == null ? null !/*FIX all null! -> null*/ : new XAttribute("Model", Model.FullClassName),
                            MasterTemplate == null ? null ! : new XAttribute("MasterTemplate", ctx.Include(MasterTemplate)),
                            new XAttribute("GroupResults", GroupResults),
                            Filters.IsNullOrEmpty() ? null ! : new XElement("Filters", Filters.Select(f => f.ToXml(ctx)).ToList()),
                            Orders.IsNullOrEmpty() ? null ! : new XElement("Orders", Orders.Select(o => o.ToXml(ctx)).ToList()),
                            new XAttribute("IsBodyHtml", IsBodyHtml),
                            From == null ? null ! : new XElement("From",
                                                                 From.DisplayName != null ? new XAttribute("DisplayName", From.DisplayName) : null !,
                                                                 From.EmailAddress != null ? new XAttribute("EmailAddress", From.EmailAddress) : null !,
                                                                 From.Token != null ? new XAttribute("Token", From.Token.Token.FullKey()) : null !,
                                                                 new XAttribute("WhenMany", From.WhenMany),
                                                                 new XAttribute("WhenNone", From.WhenNone)
                                                                 ),
                            new XElement("Recipients", Recipients.Select(rec =>
                                                                         new XElement("Recipient",
                                                                                      rec.DisplayName.HasText()? new XAttribute("DisplayName", rec.DisplayName) : null !,
                                                                                      rec.EmailAddress.HasText()? new XAttribute("EmailAddress", rec.EmailAddress) : null !,
                                                                                      new XAttribute("Kind", rec.Kind),
                                                                                      rec.Token != null ? new XAttribute("Token", rec.Token?.Token.FullKey() !) : null !,
                                                                                      new XAttribute("WhenMany", rec.WhenMany),
                                                                                      new XAttribute("WhenNone", rec.WhenNone)
                                                                                      )
                                                                         )),
                            new XElement("Messages", Messages.Select(x =>
                                                                     new XElement("Message",
                                                                                  new XAttribute("CultureInfo", x.CultureInfo.Name),
                                                                                  new XAttribute("Subject", x.Subject),
                                                                                  new XCData(x.Text)
                                                                                  ))),

                            this.Applicable?.Let(app => new XElement("Applicable", new XCData(app.Script))) !
                            ));
    }
Exemplo n.º 18
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))))));
 }
Exemplo n.º 19
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("UserTreePart",
                         new XAttribute(nameof(UserQuery), ctx.Include(UserQuery))
                         ));
 }
Exemplo n.º 20
0
 public XElement ToXml(IToXmlContext ctx)
 {
     return(new XElement("ScheduleRuleWeekDays",
                         new XAttribute("Guid", this.Guid),
                         new XAttribute("StartingOn", this.StartingOn.ToString("o", CultureInfo.InvariantCulture)),
                         new XAttribute("Monday", this.Monday),
                         new XAttribute("Tuesday", this.Monday),
                         new XAttribute("Wednesday", this.Monday),
                         new XAttribute("Thursday", this.Monday),
                         new XAttribute("Friday", this.Monday),
                         new XAttribute("Saturday", this.Monday),
                         new XAttribute("Sunday", this.Monday),
                         new XAttribute("Holiday", this.Holiday),
                         this.Calendar == null ? null ! : new XAttribute("HolidayCalendar", ctx.Include(this.Calendar))));
 }