public void Run() { // Criação de objetos dataBaseCores dB = new dataBaseCores(); KeyValuePair <int, string> cor = new KeyValuePair <int, string>(1, "preto"); string corbuscada = "amarelo"; invokerDb invoker = new invokerDb(); //Commandos command exibircores = new ExibirTodasasCores(dB); command mudarvalor = new Mudarvalor(dB, cor); command buscarcor = new BuscarCor(dB, corbuscada); //Setar commandos invoker.AddCommand(exibircores); invoker.AddCommand(mudarvalor); invoker.AddCommand(exibircores); invoker.AddCommand(buscarcor); //Executar lista de commandos invoker.ExcuteCommandsList(); }
public ExibirTodasasCores(dataBaseCores db) : base(db) { }
public BuscarCor(dataBaseCores db, string cor) : base(db, cor) { }
public Mudarvalor(dataBaseCores db, KeyValuePair <int, string> cor) : base(db, cor) { }
public command(dataBaseCores db, KeyValuePair <int, string> cor) { this._db = db; this._cor = cor; }
public command(dataBaseCores db, string cor) { this._db = db; this._cor = new KeyValuePair <int, string>(); this._corNome = cor; }
public command(dataBaseCores db) { this._db = db; }