public SecretaryGUI(ClientControllers.Client client)
 {
     InitializeComponent();
     this.client = new ClientControllers.Client(new System.Net.IPEndPoint(IPAddress.Parse("127.0.0.1"), 65432));
     if (client.ClientConnected())
     {
         IPersistable[] Iper  = client.GetAllCases();
         List <Case>    cases = new List <Case>();
         foreach (Case item in Iper)
         {
             cases.Add(item);
         }
         dgCases.ItemsSource = cases;
     }
     if (client.ClientConnected())
     {
         IPersistable[] Iper  = client.GetAllCases();
         List <Case>    cases = new List <Case>();
         foreach (Case item in Iper)
         {
             cases.Add(item);
         }
         dgCases.ItemsSource = cases;
     }
 }
Exemple #2
0
        public MainWindow()
        {
            client = new ClientControllers.Client(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 65432));
            ClientGuiLogic logic   = new ClientGuiLogic();
            WeatherApi     weather = logic.Weather();

            InitializeComponent();
            lblWeather.Content = weather.Main.Temp;
            for (int i = 0; i < 10000; i++)
            {
                if (client.ClientConnected())
                {
                    IPersistable[] Iper  = client.GetAllCases();
                    List <Case>    cases = new List <Case>();
                    foreach (Case item in Iper)
                    {
                        cases.Add(item);
                    }
                    MessageBox.Show("success");
                }
            }
        }