Files
Aaru/Aaru.Gui/Main.cs

80 lines
3.1 KiB
C#
Raw Normal View History

2020-07-19 22:01:25 +01:00
// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : Main.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : GUI.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
2024-12-19 10:45:18 +00:00
// Copyright © 2011-2025 Natalia Portillo
2020-07-19 22:01:25 +01:00
// ****************************************************************************/
2025-08-20 18:51:05 +01:00
using System;
2020-07-09 01:31:53 +01:00
using System.Text;
using Avalonia;
2025-08-20 18:51:05 +01:00
using Sentry;
namespace Aaru.Gui;
2022-03-06 13:29:38 +00:00
public static class Main
{
2022-03-06 13:29:38 +00:00
public static int Start(string[] args)
{
SentrySdk.Init(static options =>
2025-08-20 18:51:05 +01:00
{
// A Sentry Data Source Name (DSN) is required.
// See https://docs.sentry.io/product/sentry-basics/dsn-explainer/
// You can set it in the SENTRY_DSN environment variable, or you can set it in code here.
options.Dsn = "https://153a04fb97b78bb57a8013b8b30db04f@sentry.claunia.com/8";
2025-08-20 18:51:05 +01:00
// When debug is enabled, the Sentry client will emit detailed debugging information to the console.
// This might be helpful, or might interfere with the normal operation of your application.
// We enable it here for demonstration purposes when first trying Sentry.
// You shouldn't do this in your applications unless you're troubleshooting issues with Sentry.
//options.Debug = true;
// This option is recommended. It enables Sentry's "Release Health" feature.
options.AutoSessionTracking = true;
// Set TracesSampleRate to 1.0 to capture 100%
// of transactions for tracing.
// We recommend adjusting this value in production.
options.TracesSampleRate = 1.0;
options.IsGlobalModeEnabled = true;
});
try
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
return BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
}
catch(Exception ex)
{
SentrySdk.CaptureException(ex);
}
return -1;
}
2022-03-06 13:29:38 +00:00
// Avalonia configuration, don't remove; also used by visual designer.
2025-08-20 21:19:43 +01:00
public static AppBuilder BuildAvaloniaApp() => AppBuilder.Configure<App>().UsePlatformDetect();
}