Ejemplo n.º 1
0
        public MainWindow(IGenerator generator, ICallService callService, IAgentService agentService, IConsoleService consoleService, IOptions <AppSettings> settings)
        {
            InitializeComponent();

            this.generator      = generator;
            this.callService    = callService;
            this.consoleService = consoleService;
            this.agentService   = agentService;
            this.settings       = settings.Value;

            var allAgents = agentService.GetAllAgents();

            foreach (var agent in allAgents)
            {
                AgenstList.Items.Add(agent);
            }



            Calls      = new Queue <Call>();
            ActiveCall = new List <Call>();
            var newCalls = callService.GenerateCalls();

            foreach (var call in newCalls)
            {
                Calls.Enqueue(call);
            }


            LogConsole.Items.Add(consoleService.CallInfo(Calls.Count()));
            Task.Factory.StartNew(() =>
            {
                BeginInvokeExample();
            });
        }