05 2017 档案
摘要:namespace MultipleMementoPattern { // 联系人 public class ContactPerson { public string Name { get; set; } public string MobileNum { get; set; } } // 发起人 public ...
阅读全文
摘要:namespace VistorPattern { // 抽象元素角色 public abstract class Element { public abstract void Accept(IVistor vistor); public abstract void Print(); } // 具体元素A publ...
阅读全文
摘要:namespace ChainofResponsibility { // 采购请求 public class PurchaseRequest { // 金额 public double Amount { get; set; } // 产品名字 public string ProductName { get;...
阅读全文
摘要:powershell命令行找System.Management.Automation.dll命令 : [psobject].Assembly.Location powershell命令行找System.Management.Automation.dll命令 : [psobject].Assembly
阅读全文
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; namespace setIp { public class Command { /**/ /// /// ...
阅读全文
摘要:新建build.cake文件: 在powershell中执形:build.ps1 会 build当前解决方案下的所有项目 更多用法参考: http://cakebuild.net/
阅读全文
摘要:// 客户端调用 class Client { static void Main(string[] args) { // 创建一个菠菜实例并调用模板方法 Spinach spinach = new Spinach(); spinach.CookVegetabel(); ...
阅读全文
摘要:// 客户端调用 class Client { static void Main(string[] args) { // 创建一个代理对象并发出请求 Person proxy = new Friend(); proxy.BuyProduct(); Con...
阅读全文
摘要:// 教官,负责调用命令对象执行请求 public class Invoke { public Command _command; public Invoke(Command command) { this._command = command; } public void...
阅读全文
摘要:代码中存在多个if-else语句的情况下,此时可以考虑使用责任链模式来对代码进行重构。
阅读全文
摘要:Isnull(null,1); 返回 1 isnull(1,3);返回 3
阅读全文
摘要:namespace StatePatternSample { public class Account { public State State {get;set;} public string Owner { get; set; } public Account(string owner) { ...
阅读全文
摘要:function domChange(domId, callback) { // select the target node var target = document.getElementById(domId); // create an observer instance var observ...
阅读全文
摘要:namespace MediatorPattern { // 抽象牌友类 public abstract class AbstractCardPartner { public int MoneyCount { get; set; } public AbstractCardPartner() { Mo...
阅读全文
摘要:namespace ObserverInNET { class Program { // 委托充当订阅者接口类 public delegate void NotifyEventHandler(object sender); // 抽象订阅号类 public class TenXun { ...
阅读全文
摘要:// 抽象聚合类 public interface IListCollection { Iterator GetIterator(); } // 迭代器抽象类 public interface Iterator { bool MoveNext(); Object GetCurrent(); ...
阅读全文