public void CreateChild(TemplateSetItem flow)
 {
     if (ucCtrlBlockList.Visible)
     {
         ucCtrlBlockList.AddTemplateItem(flow);
     }
 }
 public void Remove(TemplateSetItem flow)
 {
     for (int i = 0; i < CurrentFlowList.Count; i++)
     {
         if (CurrentFlowList[i].Equals(flow))
         {
             CurrentFlowList.RemoveAt(i);
             break;
         }
     }
 }
 public void Remove(TemplateSetItem flow)
 {
     for (int i = 0; i < CurrentFlowList.Count; i++)
     {
         if (CurrentFlowList[i].Equals(flow))
         {
             CurrentFlowList.RemoveAt(i);
             break;
         }
     }
 }
 public void MoveUp(TemplateSetItem flow)
 {
     for (int i = 0; i < CurrentFlowList.Count; i++)
     {
         if (CurrentFlowList[i].Equals(flow))
         {
             if (i > 0)
             {
                 CurrentFlowList.RemoveAt(i);
                 CurrentFlowList.Insert(i - 1, flow);
             }
             break;
         }
     }
 }
 public void MoveDown(TemplateSetItem flow)
 {
     for (int i = 0; i < CurrentFlowList.Count; i++)
     {
         if (CurrentFlowList[i].Equals(flow))
         {
             if (i < CurrentFlowList.Count - 1)
             {
                 CurrentFlowList.RemoveAt(i);
                 CurrentFlowList.Insert(i + 1, flow);
             }
             break;
         }
     }
 }
 public void AddFlow(TemplateSetItem flow)
 {
     flow.Index = GetMaxIndex();
     CurrentFlowList.Add(flow);
 }
 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);
 }
 public void AddFlow(TemplateSetItem flow)
 {
     flow.Index = GetMaxIndex();
     CurrentFlowList.Add(flow);
 }
Exemplo n.º 10
0
        public override bool Equals(object obj)
        {
            TemplateSetItem item = obj as TemplateSetItem;

            return(Iid.Equals(item.Iid));
        }
 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;
 }