当前位置: 首页 > news >正文

深圳系统开发高端网站建设做网站要那些工具

深圳系统开发高端网站建设,做网站要那些工具,做网站买域名多少钱,铁路工程建设材料预算价格2网站装饰模式(Decorator Pattern)#xff1a; 动态地给一个对象增加一些额外的职责#xff0c;就增加对象功能来说#xff0c;装饰模式比生成子类实现更为灵活。 模式角色与结构#xff1a; 示例代码#xff1a; using System; using System.Collections.Generic; using Syste…装饰模式(Decorator Pattern) 动态地给一个对象增加一些额外的职责就增加对象功能来说装饰模式比生成子类实现更为灵活。 模式角色与结构 示例代码 using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace CSharp.DesignPattern.DecoratorPattern {class Program{static void Main(string[] args){Component component;Component componentDecorator;component new Window();componentDecorator new ScrollBarDecorator(component);componentDecorator.display();component new TextBox();componentDecorator new BlackBorderDecorator(component);componentDecorator.display();Console.ReadLine();}}// 抽象构件abstract class Component{public abstract void display();}// 具体构件class Window : Component{public override void display(){Console.WriteLine(Window...);}}class TextBox : Component{public override void display(){Console.WriteLine(TextBox...);}}// 抽象装饰类class ComponentDecorator : Component{private Component component; // 维持对抽象构件类型对象的引用public ComponentDecorator(Component component) // 注入抽象构件类型的对象{this.component component;}public override void display(){component.display();}}// 具体装饰类class ScrollBarDecorator : ComponentDecorator{public ScrollBarDecorator(Component component) : base(component){ }public override void display(){this.SetScrollBar();base.display();}public void SetScrollBar(){Console.WriteLine(Add Scroll Bar...);}}class BlackBorderDecorator : ComponentDecorator{public BlackBorderDecorator(Component component): base(component){ }public override void display(){this.SetBlackBorder();base.display();}public void SetBlackBorder(){Console.WriteLine(Add Black Border...);}} }  转载于:https://www.cnblogs.com/thlzhf/p/3993371.html
http://www.pierceye.com/news/792562/

相关文章:

  • 青岛有没有专门做淘宝网站中国建设人才网站
  • 网站移动端是什么问题吗怎样自己做免费的网站
  • 做网站没有做退钱宁波品牌策划公司
  • 网站备案 不关站家乡网页制作模板
  • 成都网站建设企业 排名网络营销推广方案ppt
  • 阳西住房和城乡规划建设局网站微信公众号商城制作
  • 石家庄自助建站软件邯郸做紧固件网站
  • 做川菜的网站动画制作网页
  • 网站建设的英文域名注册需要什么条件
  • wordpress管理系统贵州seo和网络推广
  • 网站第二次备案设计方案审核合格后由谁签字确认
  • 网页设计和网站编辑wordpress 页面瀑布流
  • 福田网站建设龙岗网站建设ie的常用网站
  • 网站推广途径和推广要点地产网站方案
  • 用asp做的网站2021互联网公司100强
  • 网站运营无经验可以做吗垂直类网站怎么做
  • 中国站长网站wordpress开启xmlrpc
  • 网站建设的好处建设工程质量管理条例网站
  • asp.net网站建设教程做电影网站 需要进那些群
  • 2013网站挂马教程长沙网站建设优化
  • 网站搭建详细教程wordpress 找不到主题
  • 陕西省建设厅申报网站大型网站建设公司推荐
  • 企业商城建站外贸建站上海
  • 织梦如何做网站网页设计公司背景
  • 购买域名网站程序员外包公司到底值不值得去
  • 网站出售商品建设广告公司主要做什么
  • 西安的电商网站设计大庆市城乡建设局网站
  • 服装网站建设需要什么内容中国建设银行总行官方网站
  • 免费下载设计素材网站wordpress metaslider
  • 如何建一个自己的网站给网站做rss