Пример #1
0
 public static EFTemplate BuildTemplateFromDataContainer(IEnumerable<DataControl.DataContainer> dataContainer)
 {
     var root = new EFTemplate();
     root.ElementName = "Root Template";
     root.OrderIndex = 1;
     int idx = 2;
     foreach (var container in dataContainer)
     {
         idx++;
         var dataUnit = container.Data;
         var field = dataUnit.DataField;
         var tmpl = new EFTemplate();
         tmpl.DataField = field;
         tmpl.ElementName = field.FieldName;
         tmpl.Parent = root;
         tmpl.OrderIndex = idx;
     }
     return root;
 }
Пример #2
0
 private static void UpdateLayoutPanelFromTemplate(EFTemplate template, DataContainerLayoutPanel panel, bool editMode)
 {
     foreach (var tmpl in template.Children)
     {
         UpdateLayoutPanel(tmpl.DataField, panel, editMode);
         UpdateLayoutPanelFromTemplate(tmpl, panel, editMode);
     }
 }
Пример #3
0
 public static void BuildDataContainerFromTemplate(EFTemplate template, DataContainerLayoutPanel panel, bool editMode)
 {
     panel.Controls.Clear();
     UpdateLayoutPanelFromTemplate(template, panel, editMode);
 }