这是我的构建器界面:
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)