public void CreateChild(TemplateSetItem flow) { if (ucCtrlBlockList.Visible) { ucCtrlBlockList.AddTemplateItem(flow); } }
private string GetItemHtmlByFlow(TemplateSetItem flow, TemplateObject obj) { string html = flow.Template.InnerHTML; if (obj.Category.Equals("List", StringComparison.OrdinalIgnoreCase)) { TemplateObject item = obj.Children[0]; if (item.Children != null && item.Children.Count > 0 && item.Children.Count == flow.ChildrenCount) { for (int i = 0; i < item.Children.Count; i++) { TemplateObject sub = item.Children[i]; string oldText = sub.OuterHTML; if (sub.NoUse) { html = html.Replace(oldText, ""); } else { int index; if (int.TryParse(sub.DataSource, out index)) { string newText = flow.Value.Split(',')[index]; html = html.Replace(oldText, newText); } else { } } } } } return(html); }
public void AddChild(string defaultValue) { if (currentModule != null) { TemplateObject clone = currentModule.Clone(); clone.DefaultValue = defaultValue; if (defaultValue.Split(',').Length >= clone.Children.Count) { TemplateSetItem flow = new TemplateSetItem(); flow.Action = "Add"; flow.ChildrenCount = clone.Children.Count; flow.ContainerId = clone.Id; flow.Value = defaultValue; flow.Template = clone; CurrentTemplateSetFlow.AddFlow(flow); } } }
public void AddTemplateItem(TemplateSetItem flow) { CurrentDataSource.Add(flow); }