예제 #1
0
        public MainWindow()
        {
            InitializeComponent();
            logBox.Document.Blocks.Remove(logBox.Document.Blocks.FirstBlock);
            this.Hide();
            HostLog1       = new HostLogs();
            HostLog1.Title = "Host 1";
            HostLog2       = new HostLogs();
            HostLog2.Title = "Host 2";
            HostLog3       = new HostLogs();
            HostLog3.Title = "Host 3";
            HostLog1.Show();
            HostLog2.Show();
            HostLog3.Show();

            Hosts hosts1 = new Hosts(1, HostLog1);
            Hosts hosts2 = new Hosts(2, HostLog2);
            Hosts hosts3 = new Hosts(3, HostLog3);

            CPCC cpcc1 = new CPCC(HostLog1);

            cpcc1.CPCCStart(1);
            CPCC cpcc2 = new CPCC(HostLog2);

            cpcc2.CPCCStart(2);
            CPCC cpcc3 = new CPCC(HostLog3);

            cpcc3.CPCCStart(3);



            HostLog1.myHost = hosts1;
            HostLog1.myCPCC = cpcc1;
            HostLog2.myHost = hosts2;
            HostLog2.myCPCC = cpcc2;
            HostLog3.myHost = hosts3;
            HostLog3.myCPCC = cpcc3;
            HostLog1.FillDistantHosts();
            HostLog2.FillDistantHosts();
            HostLog3.FillDistantHosts();

            //Task.Run(() => { hosts1.SendMessage(); });
            //Task.Run(() => { cpcc1.SendMessage("127.0.0.1", "dzien dobry"); });
            //Task.Run(() => { cpcc1.SendMessage("127.0.0.1", "dzien dobry"); });
            //Task.Run(() => { hosts1.SendMessage("127.0.0.10", "127.0.0.30", "13"); });

            //Task.Run(() => { cpcc1.SendCallRequest("host1", "host3", "600"); });
            //Task.Run(() => { cpcc1.SendMessage("127.0.0.2", "dzien dobry "); });
        }
예제 #2
0
        public CPCC(HostLogs tmp)
        {
            myWindow = tmp;

            _cpcc = this;
        }