Esempio n. 1
0
 public DesignerBoard Warp()
 {
     foreach (object obj in this.Children)
     {
         if (obj is DesignerItem)
         {
             //获取DesignerItem中直接包含的BoardControl
             DesignerControl clonedChild = (DesignerControl)((obj as DesignerItem).Content as IDesigner).GetDesignerModel();
             this.Board.AddVisualControl(clonedChild);
             if (clonedChild is DesignerChart)
             {
                 foreach (DesignerChartDataSerie dcd in (clonedChild as DesignerChart).Series)
                 {
                     IDynamicData idd = dcd as IDynamicData;
                     if (!string.IsNullOrEmpty(idd.DataSourceKey))
                     {
                         DesignerDataSource ds = DataSourceManager.GetDataSource(idd.DataSourceKey);
                         this.Board.AddBackControl(ds);
                     }
                 }
             }
             //若该设计模型是动态数据类型,则将该数据接口添加至Board的后台元素集合中
             if (clonedChild is IDynamicData)
             {
                 IDynamicData idd = clonedChild as IDynamicData;
                 if (!string.IsNullOrEmpty(idd.DataSourceKey))
                 {
                     DesignerDataSource ds = DataSourceManager.GetDataSource(idd.DataSourceKey);
                     this.Board.AddBackControl(ds);
                 }
             }
         }
     }
     return(this.Board);
 }
 public DynamicDataController(IDynamicData dynamicData)
 {
     _dynamicData = dynamicData;
 }