コード例 #1
0
    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();
    }
コード例 #2
0
 public ExibirTodasasCores(dataBaseCores db) : base(db)
 {
 }
コード例 #3
0
 public BuscarCor(dataBaseCores db, string cor) : base(db, cor)
 {
 }
コード例 #4
0
 public Mudarvalor(dataBaseCores db, KeyValuePair <int, string> cor) : base(db, cor)
 {
 }
コード例 #5
0
 public command(dataBaseCores db, KeyValuePair <int, string> cor)
 {
     this._db  = db;
     this._cor = cor;
 }
コード例 #6
0
 public command(dataBaseCores db, string cor)
 {
     this._db      = db;
     this._cor     = new KeyValuePair <int, string>();
     this._corNome = cor;
 }
コード例 #7
0
 public command(dataBaseCores db)
 {
     this._db = db;
 }