private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         OnOpen(null);
         if (RobotInstance.instance.ProjectCount > 0)
         {
             RobotInstance.instance.Projects.First().IsExpanded = true;
         }
         if (string.IsNullOrEmpty(Config.local.wsurl))
         {
             try
             {
                 ReadyForAction?.Invoke();
             }
             catch (Exception ex)
             {
                 Log.Error(ex.ToString());
             }
         }
         // WindowState = WindowState.Minimized;
     }
     catch (Exception ex)
     {
         Log.Error(ex.ToString());
         throw;
     }
 }
 public void WebSocketClient_OnOpen()
 {
     if (RobotInstance.instance.Projects.Count == 0 && first_connect)
     {
     }
     if (first_connect)
     {
         try
         {
             ReadyForAction?.Invoke();
         }
         catch (Exception ex)
         {
             Log.Error(ex.ToString());
         }
         first_connect = false;
     }
 }
 public void MainWindow_WebSocketClient_OnOpen()
 {
     Log.FunctionIndent("AgentWindow", "MainWindow_WebSocketClient_OnOpen");
     if (RobotInstance.instance.Projects.Count == 0 && first_connect)
     {
     }
     if (first_connect)
     {
         try
         {
             ReadyForAction?.Invoke();
         }
         catch (Exception ex)
         {
             Log.Error(ex.ToString());
         }
         first_connect = false;
     }
     Log.FunctionOutdent("AgentWindow", "MainWindow_WebSocketClient_OnOpen");
 }