using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; using System.Runtime.InteropServices.WindowsRuntime; using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Controls; using Microsoft.UI.Xaml.Controls.Primitives; using Microsoft.UI.Xaml.Data; using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media; using Microsoft.UI.Xaml.Navigation; using Microsoft.UI.Xaml.Shapes; using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. namespace APIToolkit { /// /// Provides application-specific behavior to supplement the default Application class. /// public partial class App : Application { /// /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// public App() { this.InitializeComponent(); GlobalMethods.WebRequest.BaseAddress = new Uri("https://enstrayed.com/api/"); // Set base address for web requests being made GlobalMethods.WebRequest.DefaultRequestHeaders.UserAgent.ParseAdd($"DotNet/{Environment.Version} APIToolkit/{GlobalMethods.Version}"); // Set user agent of client } /// /// Invoked when the application is launched. /// /// Details about the launch request and process. protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) { m_window = new MainWindow(); m_window.Activate(); } private Window? m_window; } public static class GlobalMethods { public static HttpClient WebRequest = new(); public static string Version = "1.0"; } }