小编Ang*_*oos的帖子

构建器设计模式:访问/传递模型数据到/在具体类中

这是我的构建器界面:

public interface IContainerBuilder {
  void SetSections();
  void SetSides();
  void SetArea();
  WebControl GetContainer();
}
Run Code Online (Sandbox Code Playgroud)

这是我的ConcreteBuilder:

public class SingleContainerBuilder:BaseProperties, IContainerBuilder {
  Panel panel = new Panel();
  public void SetSections() {
    //panel.Height = value coming from model
    //panel.Width = value coming from model
  }
  public void SetSides() {
    //panel.someproperty = //value coming from model,
    //panel.someotherproperty = //value coming from model,
  }
  public void SetArea() {
    throw new NotImplementedException();
  }
  public System.Web.UI.WebControls.WebControl GetContainer() {
    return panel;
  }
}
Run Code Online (Sandbox Code Playgroud)

主任在这里:

public class ContainerBuilder { …
Run Code Online (Sandbox Code Playgroud)

c# asp.net design-patterns

6
推荐指数
1
解决办法
234
查看次数

标签 统计

asp.net ×1

c# ×1

design-patterns ×1