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

微企点做的网站百度搜得到吗百度入口网站

微企点做的网站百度搜得到吗,百度入口网站,怎么样自己做网站赚钱年入40万,网站页面链接怎么做的命令模式是对命令的封装,目的就是要把发出命令和执行命令分割开来。 以下的例子,用校长发送命令给学生来来说明命令发送的整个过程,其中老师作为命令的中转站必不可少。 using System; using System.Collections; using System.Collections.G…

  命令模式是对命令的封装,目的就是要把发出命令和执行命令分割开来。

  以下的例子,用校长发送命令给学生来来说明命令发送的整个过程,其中老师作为命令的中转站必不可少。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;namespace ConsoleApplication1
{class Program{/// <summary>/// 命令接受者学生接口/// </summary>public abstract class Student{public abstract void Action();}/// <summary>/// 命令接受者学生A/// </summary>public class StudentA : Student{public override void Action(){Console.WriteLine("StudentA do the action");}}/// <summary>/// 命令接受者学生B/// </summary>public class StudentB : Student{public override void Action(){Console.WriteLine("StudentB do the action");}}/// <summary>/// 命令抽象类/// </summary>public abstract class Command{protected Student student;public Command(Student student){this.student = student;}public abstract void Execute();}/// <summary>/// 具体命令/// </summary>public class ConcreteCommand : Command{public ConcreteCommand(Student student) :base(student){}public override void Execute(){student.Action();}}/// <summary>/// 命令请求者/// </summary>public class Teacher{private Command command;public void SetCommand(Command command){this.command = command;}public void ExecuteCommand(){command.Execute();}}/// <summary>/// 客户端 如校长/// </summary>/// <param name="args"></param>static void Main(string[] args){StudentA sa = new StudentA();StudentB sb = new StudentB();Command c1 = new ConcreteCommand(sa);Command c2 = new ConcreteCommand(sb);Teacher teacher = new Teacher();teacher.SetCommand(c1);teacher.ExecuteCommand();teacher.SetCommand(c2);teacher.ExecuteCommand();}}
}

  如果要执行一串命令可以用list数据结构进行封装。

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;namespace ConsoleApplication1
{class Program{/// <summary>/// 命令接受者学生接口/// </summary>public abstract class Student{public abstract void Action();}/// <summary>/// 命令接受者学生A/// </summary>public class StudentA : Student{public override void Action(){Console.WriteLine("StudentA do the action");}}/// <summary>/// 命令接受者学生B/// </summary>public class StudentB : Student{public override void Action(){Console.WriteLine("StudentB do the action");}}/// <summary>/// 命令抽象类/// </summary>public abstract class Command{protected Student student;public Command(Student student){this.student = student;}public abstract void Execute();}/// <summary>/// 具体命令/// </summary>public class ConcreteCommand : Command{public ConcreteCommand(Student student) :base(student){}public override void Execute(){student.Action();}}/// <summary>/// 命令请求者/// </summary>public class Teacher{private List<Command> command;public void SetCommand(List<Command> command){this.command = command;}public void ExecuteCommand(){foreach (var c in command){c.Execute();}}}/// <summary>/// 客户端 如校长/// </summary>/// <param name="args"></param>static void Main(string[] args){StudentA sa = new StudentA();StudentB sb = new StudentB();Command c1 = new ConcreteCommand(sa);Command c2 = new ConcreteCommand(sb);List<Command> command = new List<Command>();command.Add(c1);command.Add(c2);Teacher teacher = new Teacher();teacher.SetCommand(command);teacher.ExecuteCommand();}}
}

 

转载于:https://www.cnblogs.com/zkzk945/p/5109678.html

http://www.lbrq.cn/news/2741599.html

相关文章:

  • 郑州app软件定制夫唯seo教程
  • 国内做视频课程的网站有哪些腾讯云域名注册官网
  • 自动做简历的网站模板建站
  • 网站开发学那个语言比较好关键时刻
  • 绵阳公司网站制作公司seo新手快速入门
  • 头条号链接其他网站怎么做广州企业网站建设
  • 河间做网站seo优化必备技巧
  • 网站创建方法手机关键词seo排名优化
  • 网站制作方案策划书长春建站程序
  • 一个网络空间如何做两个网站正规seo排名公司
  • 哪个网站可以找题目给小孩做seo站外推广有哪些
  • 做 专而精 的网站制作网站的工具
  • 做好的网站怎么优化金花站长工具
  • 网页设计的网站推荐如何在百度发广告推广
  • 旋风加速官网下载seo系统培训哪家好
  • 潍坊哪家网站制作公司好搜索引擎调词工具
  • 公司做网站怎么收费如何推广公司
  • 网站建设的编程广州网站推广服务
  • 济南手机建站价格搜索引擎优化自然排名的优点
  • 公司如何申请域名网站seo设计方案案例
  • 西安做网站电话医院线上预约
  • 旅游网站毕业论文seo智能优化软件
  • 怎样建立网站的快捷方式河南郑州网站顾问
  • 厦门 微网站建设公司培训机构网站模板
  • 如何设计一个网站没灵感百度ai人工智能
  • 静态网站做淘宝客爱站工具包的模块有哪些
  • 全国工厂的网站建设seo软件优化
  • 怎么做网站上的销售代北京网站排名推广
  • 江苏建设部官方网站优化关键词的正确方法
  • 2012系统 做网站百度做网站
  • Spark03-RDD02-常用的Action算子
  • 简单的 VSCode 设置
  • JavaScript字符串详解
  • 字符串的说明以及应用
  • 云安全 - The Big IAM Challenge
  • HTTP 1.0, 2.0 和 3.0 有什么区别?