private async void Page_Loaded(object sender, RoutedEventArgs e) { if (!Config.Current.IsTargetServerConfigurable) { stackServerInfo.Visibility = Visibility.Collapsed; buttonConnect.HorizontalAlignment = HorizontalAlignment.Center; } if (Config.Current.IsClientAutoConnectEnabled && !AditClient.IsConnected) { stackConnect.Visibility = Visibility.Collapsed; stackMain.Visibility = Visibility.Visible; await AditClient.Connect(); } RefreshUI(); }
private async void ConnectButtonClicked(object sender, RoutedEventArgs e) { Config.Current.ClientHost = textHost.Text; if (int.TryParse(textPort.Text, out var port)) { Config.Current.ClientPort = port; } else { Utilities.ShowToolTip(textPort, System.Windows.Controls.Primitives.PlacementMode.Left, "Invalid port."); return; } stackConnect.Visibility = Visibility.Collapsed; stackMain.Visibility = Visibility.Visible; Utilities.ShowToolTip(stackMain, System.Windows.Controls.Primitives.PlacementMode.Center, "Attempting to connect..."); await AditClient.Connect(); }
public static async Task ProcessCommandLineArgs(string[] args) { if (args.Contains("-upgrade")) { var index = args.ToList().IndexOf("-upgrade") + 1; AditClient.SessionID = args[index]; Config.Current.StartupMode = Config.StartupModes.Notifier; await AditClient.Connect(args[index]); } else if (args.Contains("-background")) { Config.Current.StartupMode = Config.StartupModes.Background; } else { Config.Current.StartupMode = Config.StartupModes.Normal; } }