public App() { // SfdcSDK InitializeSfdcConfig(); SDKManager.CreateClientManager(false); SDKManager.RootApplicationPage = typeof(VisualBrowserPage); SDKManager.EndLoginCallBack = () => { Messenger.Default.Send(new UserLogInMessage()); }; PlatformAdapter.Resolve <ISFApplicationHelper>().Initialize(); // Set up the Logging Service and the custom log action function in the PlatformAdapter var target = new LogFileTarget(); target.RetainDays = 10; LoggingServices.DefaultConfiguration.AddTarget(LoggingLevel.Information, target); PlatformAdapter.SetCustomLoggerAction(LoggingServices.LogAction); // Continue App setup InitializeComponent(); Suspending += OnSuspending; Resuming += OnResuming; // Setup the global crash handler GlobalCrashHandler.Configure(); }
private void ConfigureLogger() { GlobalCrashHandler.Configure(); var target = new StreamingFileTarget(new SingleLineLayout()); target.RetainDays = Int32.MaxValue; LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, target); }
/// <summary> /// 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(). /// </summary> public App() { InitializeComponent(); Suspending += OnSuspending; UnhandledException += OnUnhandledException; ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen; GlobalCrashHandler.Configure(); }
public App() { Ioc.Register(); _walletRepository = ServiceLocator.Current.GetInstance <IWalletRepository>(); InitializeComponent(); Suspending += OnSuspending; GlobalCrashHandler.Configure(); _walletRepository.LoadAsync().Wait(); }
/// <summary> /// 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(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; #if DEBUG LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget()); #else LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Error, LogLevel.Fatal, new FileStreamingTarget()); #endif GlobalCrashHandler.Configure(); }
/// <summary> /// 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(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; //Log everything from Info to Fatal levels to a file. LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Info, LogLevel.Fatal, new MetroLog.Targets.StreamingFileTarget()); //Log any crashes that occur and their stack trace. GlobalCrashHandler.Configure(); }
/// <summary> /// 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(). /// </summary> public App() { var settings = LogManagerFactory.CreateLibraryDefaultSettings(); settings.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget()); Log = LogManagerFactory.CreateLogManager(settings).GetLogger <App>(); this.InitializeComponent(); this.Suspending += OnSuspending; UnhandledException += App_UnhandledException; GlobalCrashHandler.Configure(); }
/// <summary> /// 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(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; // debug? #if DEBUG LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new DebugTarget()); #endif // setup the global crash handler... GlobalCrashHandler.Configure(); }
/// <summary> /// 初始化单一实例应用程序对象。这是执行的创作代码的第一行, /// 已执行,逻辑上等同于 main() 或 WinMain()。 /// </summary> public App() { Microsoft.HockeyApp.HockeyClient.Current.Configure("314f174d9eaa4562975c99e4972fcc1e"); this.InitializeComponent(); this.Suspending += OnSuspending; #if DEBUG LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); #else LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Info, LogLevel.Fatal, new StreamingFileTarget()); #endif // setup the global crash handler... GlobalCrashHandler.Configure(); }
/// <summary> /// 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(). /// </summary> public App() { this.InitializeComponent(); if (AppSettings.AppTheme != null) { RequestedTheme = AppSettings.AppTheme.Value; } #if DEBUG // setup the global crash handler... GlobalCrashHandler.Configure(); #endif }
protected override async void OnLaunched(LaunchActivatedEventArgs args) { #if DEBUG LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget()); #else LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Error, LogLevel.Fatal, new FileStreamingTarget()); #endif GlobalCrashHandler.Configure(); if (!args.PrelaunchActivated) { await ActivationService.ActivateAsync(args); } }
/// <summary> /// 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(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; this.Resuming += OnResuming; //#if DEBUG // LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget()); //#else // LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Info, LogLevel.Fatal, new FileStreamingTarget()); //#endif // Set up the global crash handler GlobalCrashHandler.Configure(); }
public App() { InitializeComponent(); EnteredBackground += App_EnteredBackground; Resuming += App_Resuming; //Suspending += App_SuspendingAsync; UnhandledException += OnAppUnhandledException; // Deferred execution until used. Check https://msdn.microsoft.com/library/dd642331(v=vs.110).aspx for further info on Lazy<T> class. _activationService = new Lazy <ActivationService>(CreateActivationService); LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); GlobalCrashHandler.Configure(); // Write a FATAL entry, wait until all of the targets have finished writing, then call Application.Exit. TacticalCallsigns.CreateTacticalCallsignsData(); }
/// <summary> /// Logger must be initialized during the App initialization. /// </summary> public static void InitializeMetroLog() { bool debug = false; #if DEBUG debug = true; #endif //If debugging, everything will be logged if (debug || Utility.SettingsLoad <bool?>("debug") == true) { LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new MetroLog.Targets.StreamingFileTarget()); } //The GlobalCrashHandler can be used to ensure that a FATAL log entry is written if an unhandled exception occurs GlobalCrashHandler.Configure(); }
/// <summary> /// 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(). /// </summary> public App() { this.InitializeComponent(); this.Suspending += OnSuspending; this.UnhandledException += OnUnhandledException; #if DEBUG LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new EtwTarget()); #else LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Info, LogLevel.Fatal, new FileStreamingTarget()); #endif // setup the global crash handler... GlobalCrashHandler.Configure(); Log = LogManagerFactory.DefaultLogManager.GetLogger <App>(); Log.Info($"Started PestoreUWPClient {GetAppVersion()}"); }
public App() { var configuration = new LoggingConfiguration(); configuration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new FileStreamingTarget()); configuration.IsEnabled = true; LogManagerFactory.DefaultConfiguration = configuration; Log = LogManagerFactory.DefaultLogManager.GetLogger <App>(); UnhandledException += App_UnhandledException; GlobalCrashHandler.Configure(); BookieSettings.LoadSettings(); //var localSettings = ApplicationData.Current.LocalSettings; //var theme = localSettings.Values["Theme"]; //if (theme == null) //{ // Current.RequestedTheme = ApplicationTheme.Dark; //} //else if (theme.ToString() == "Dark") //{ // Current.RequestedTheme = ApplicationTheme.Dark; //} //else if (theme.ToString() == "Light") //{ // Current.RequestedTheme = ApplicationTheme.Light; //} WindowsAppInitializer.InitializeAsync( WindowsCollectors.Metadata | WindowsCollectors.Session); InitializeComponent(); Suspending += OnSuspending; //using (var db = new Context()) //{ // db.Database.Migrate(); //} var covers = Globals.GetCoversFolder(); }
/// <summary> /// Initialisiert das Singletonanwendungsobjekt. Dies ist die erste Zeile von erstelltem Code /// und daher das logische Äquivalent von main() bzw. WinMain(). /// </summary> public App() { path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "FileCustomCommands.xml"); // Initialize MetroLog using the defaults LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); this.logManager = LogManagerFactory.DefaultLogManager; this.logManager.GetLogger <App>().Info("App Start"); GlobalCrashHandler.Configure(); this.InitializeComponent(); this.Suspending += OnSuspending; //this.RegisterVoiceCommands(); // Settings App.settingsViewModel = new SettingsViewModel(); GetDefaultSettingsAsync(); }
/// <summary> /// 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(). /// </summary> public App() { if ((string)ApplicationData.Current.LocalSettings.Values["Theme"] == "Light") { RequestedTheme = ApplicationTheme.Light; } else { RequestedTheme = ApplicationTheme.Dark; } this.InitializeComponent(); this.Suspending += OnSuspending; //Log everything from Info to Fatal levels to a file. LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Info, LogLevel.Fatal, new MetroLog.Targets.StreamingFileTarget()); //Log any crashes that occur and their stack trace. GlobalCrashHandler.Configure(); }
public App() { InitializeComponent(); LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new MetroLog.Targets.FileStreamingTarget()); GlobalCrashHandler.Configure(); }
public App() { InitializeComponent(); SplashFactory = (e) => new Views.Splash(e); #region App settings var _settings = SettingsService.Instance; RequestedTheme = _settings.AppTheme; CacheMaxDuration = _settings.CacheMaxDuration; ShowShellBackButton = _settings.UseShellBackButton; #endregion // Initialize MetroLog LogManagerFactory.DefaultConfiguration.AddTarget(LogLevel.Trace, LogLevel.Fatal, new StreamingFileTarget()); GlobalCrashHandler.Configure(); // Initialize Tactical call signs data _tacticalCallsignDataDictionary = new Dictionary <string, TacticalCallsignData>(); TacticalCallsignData tacticalCallsignData = new TacticalCallsignData() { AreaName = "County Agencies", FileName = "CountyTacticalCallsigns.xml", StartString = "Santa Clara County Cities/Agencies", BulletinFileName = "SCCo Packet Tactical Calls" }; _tacticalCallsignDataDictionary.Add(tacticalCallsignData.FileName, tacticalCallsignData); tacticalCallsignData = new TacticalCallsignData() { AreaName = "non County Agencies", FileName = "NonCountyTacticalCallsigns.xml", StartString = "Other (non-SCCo) Agencies", BulletinFileName = "SCCo Packet Tactical Calls" }; _tacticalCallsignDataDictionary.Add(tacticalCallsignData.FileName, tacticalCallsignData); tacticalCallsignData = new TacticalCallsignData() { AreaName = "Local Mountain View", FileName = "MTVTacticalCallsigns.xml", TacticallWithBBS = "MTVEOC", StartString = "#Mountain View Tactical Call List", StopString = "#MTV001 thru MTV010 also permissible", RawDataFileName = "Tactical_Calls.txt" }; _tacticalCallsignDataDictionary.Add(tacticalCallsignData.FileName, tacticalCallsignData); tacticalCallsignData = new TacticalCallsignData() { AreaName = "Local Cupertino", FileName = "CUPTacticalCallsigns.xml", TacticallWithBBS = "CUPEOC", StartString = "# Cupertino OES", StopString = "# City of Palo Alto", RawDataFileName = "Tactical_Calls.txt" }; _tacticalCallsignDataDictionary.Add(tacticalCallsignData.FileName, tacticalCallsignData); tacticalCallsignData = new TacticalCallsignData() { AreaName = "County Hospitals", FileName = "HospitalsTacticalCallsigns.xml", TacticallWithBBS = "HOSDOC", StartString = "# SCCo Hospitals Packet Tactical Call Signs", StopString = "# HOS001 - HOS010", RawDataFileName = "Tactical_Calls.txt" }; _tacticalCallsignDataDictionary.Add(tacticalCallsignData.FileName, tacticalCallsignData); tacticalCallsignData = new TacticalCallsignData() { AreaName = "All County", FileName = "AllCountyTacticalCallsigns.xml", StartString = "", BulletinFileName = "https://scc-ares-races.org/activities/showtacticalcalls.php" }; _tacticalCallsignDataDictionary.Add(tacticalCallsignData.FileName, tacticalCallsignData); tacticalCallsignData = new TacticalCallsignData() { AreaName = "User Address Book", FileName = "UserAddressBook.xml", StartString = "", BulletinFileName = "" }; //Debug.WriteLine("Application Started"); }