コード例 #1
0
        public ProducerConsumer()
        {
            Consummer = new Shell()
            {
                StatusExecutable = true
            };
            Consummer2 = new Shell()
            {
                StatusExecutable = true
            };
            QueueShell = new Shell()
            {
                StatusExecutable = true
            };
            ProducerShell = new Shell()
            {
                StatusExecutable = true
            };
            ProducerShell2 = new Shell()
            {
                StatusExecutable = true
            };
            List <IShell> shellList = new List <IShell>();

            shellList.Add(Consummer);
            shellList.Add(Consummer2);
            shellList.Add(ProducerShell);
            shellList.Add(ProducerShell2);
            ProduceCommand2 = new ProduceCommand(ProducerShell2, QueueShell);
            ProduceCommand  = new ProduceCommand(ProducerShell, QueueShell);
            ConsumeCommand  = new ConsumeCommand(Consummer, QueueShell);
            ConsumeCommand2 = new ConsumeCommand(Consummer2, QueueShell);
            QueueCommand    = new QueueCommandG <string>(QueueShell);
            StopCommand     = new StopCommand(QueueShell, shellList);

            StopProduce   = new StopTask(ProducerShell);
            StopProduce2  = new StopTask(ProducerShell2);
            StopConsumer1 = new StopTask(Consummer);
            StopConsumer2 = new StopTask(Consummer2);
        }
コード例 #2
0
ファイル: Customer.cs プロジェクト: trungphap/PocTrading
        public Customer()
        {
            // MyCommand = new CustomerCommand(ExcuteMethod, CanExecuteMethod);
            Consummer = new Shell()
            {
                StatusExecutable = true
            };
            Consummer2 = new Shell()
            {
                StatusExecutable = true
            };
            QueueShell = new Shell()
            {
                StatusExecutable = true
            };
            ProducerShell = new Shell()
            {
                StatusExecutable = true
            };
            ProducerShell2 = new Shell()
            {
                StatusExecutable = true
            };
            OpenCommand = new OpenCommand(ProducerShell);

            ProduceCommand2 = new ProduceCommand(ProducerShell2, QueueShell);
            ProduceCommand  = new ProduceCommand(ProducerShell, QueueShell);
            ConsumeCommand  = new ConsumeCommand(Consummer, QueueShell);
            ConsumeCommand2 = new ConsumeCommand(Consummer2, QueueShell);
            QueueCommand    = new QueueCommandG <string>(QueueShell);
            StopCommand     = new StopCommand(QueueShell);

            StopProduce   = new StopTask(ProducerShell);
            StopProduce2  = new StopTask(ProducerShell2);
            StopConsumer1 = new StopTask(Consummer);
            StopConsumer2 = new StopTask(Consummer2);
        }