Beispiel #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                Message message = new Message();
                message = JsonConvert.DeserializeObject <Message>(Data.ProjectName);

                foreach (var proj in message.args)
                {
                    SelecterProject.Items.Add(proj);
                }
                SelecterProject.SelectedIndex = 0;
                LabelUserName.Content         = Data.NameUser;
                SelectProj();
                ServerConnect serverConnect = new ServerConnect();
                message = JsonConvert.DeserializeObject <Message>(serverConnect.SendMsg("AddSession", Data.NameUser, "{\"args\":[\"" + Dns.GetHostByName(Dns.GetHostName()).AddressList[0].ToString() + "\"]}"));
                Data.Id = message.args[0];


                message = JsonConvert.DeserializeObject <Message>(serverConnect.SendMsg("CheckNowTests", Data.ServiceSel));
                TestsNow(message);
            }
            catch { }
            finally
            {
                FreeRAM.Free();
            }
        }
Beispiel #2
0
        private void SetIP(object sender, RoutedEventArgs e)
        {
            Data.IPServer = IPEdit.Text.ToString();
            File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + "\\server.conf", IPEdit.Text.ToString());
            try
            {
                Message mess = new Message();
                mess.Add(Data.NameUser);
                for (int i = 0; i < projects.Children.Count; i += 2)
                {
                    CheckBox checkBox = (CheckBox)projects.Children[i];
                    if (checkBox.IsChecked == true)
                    {
                        mess.Add(checkBox.Name);
                    }
                }
                ServerConnect server = new ServerConnect();
                if (Data.NameUser != null)
                {
                    /*server.SendMsg("UpdateServises", Data.ServiceSel, JsonConvert.SerializeObject(mess));
                     * server.SendMsg("UpdateSession", Data.NameUser, "{\"args\":[\"" + Data.Id + "\"]}");*/

                    /*Message message = JsonConvert.DeserializeObject<Message>(server.SendMsg("CheckNowTests", Data.ServiceSel));
                     * mainWindow.TestsNow(message);*/
                }
            }
            catch { }
            this.Close();
        }
Beispiel #3
0
        public void Init()
        {
            IPEdit.Text = Data.IPServer;


            try
            {
                Message       services = JsonConvert.DeserializeObject <Message>(Data.ServiceName);
                Message       project  = JsonConvert.DeserializeObject <Message>(Data.ProjectName);
                ServerConnect server   = new ServerConnect();
                Message       mess     = new Message();
                mess.Add(Data.NameUser);

                /*Message message = JsonConvert.DeserializeObject<Message>(JsonConvert.DeserializeObject<Message>(server.SendMsg("ShowServises", Data.ServiceSel, JsonConvert.SerializeObject(mess))).args[0]);
                 *
                 * for (var i = 0; project.args.Count > i; i++)
                 * {
                 *  CheckBox checkBox = new CheckBox();
                 *  checkBox.Name = services.args[i];
                 *  checkBox.Margin = new Thickness(
                 *     i / 4 * 130, (i * 20) - i / 4 * 80, 0, 0);
                 *  if (message.args.Contains(checkBox.Name))
                 *      checkBox.IsChecked = true;
                 *  projects.Children.Add(checkBox);
                 *  TextBlock textBox = new TextBlock();
                 *  textBox.Text = project.args[i];
                 *
                 *  textBox.Margin = new Thickness(
                 *      i / 4 * 130 + 20, (i * 20) - i / 4 * 80, 20, 20);
                 *  textBox.Foreground = Brushes.White;
                 *  projects.Children.Add(textBox);
                 * }*/
            }
            catch { }
        }
Beispiel #4
0
        private void Send(object sender, RoutedEventArgs e)
        {
            Message args = new Message();

            args.Add(Id.Text, id);
            ServerConnect server = new ServerConnect();
            Message       res    = JsonConvert.DeserializeObject <Message>(server.SendMsg("AddBug", Data.ServiceSel, JsonConvert.SerializeObject(args)));

            this.Close();
        }
Beispiel #5
0
 private void CloseProcess(object sender, EventArgs e)
 {
     try
     {
         ServerConnect server = new ServerConnect();
         server.SendMsg("DeleteSession", Data.Id, "{\"args\":[\"" + Dns.GetHostByName(Dns.GetHostName()).AddressList[0].ToString() + "\"]}");
         foreach (Process proc in Process.GetProcessesByName("DashBoardClient"))
         {
             proc.Kill();
         }
     }
     catch (Exception ex) { MessageBox.Show(ex.Message); }
 }