Beispiel #1
0
        public App()
        {
            InitializeComponent();
            Suspending        += OnSuspending;
            LeavingBackground += OnLeavingBackground;
            // Initialize NLog
            Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            NLog.LogManager.Configuration.Variables["LogPath"] = storageFolder.Path;

            RegisterUncaughtExceptionLogger();

            ConsentDialogDisplay    = new Dialogs.ConsentDialog();
            PropertiesDialogDisplay = new Dialogs.PropertiesDialog();
            LayoutDialogDisplay     = new Dialogs.LayoutDialog();
            AddItemDialogDisplay    = new Dialogs.AddItemDialog();
            ExceptionDialogDisplay  = new Dialogs.ExceptionDialog();
            // this.UnhandledException += App_UnhandledException;
            Clipboard.ContentChanged += Clipboard_ContentChanged;
            Clipboard_ContentChanged(null, null);
            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));

            SidebarPinned                    = new SidebarPinnedModel();
            AppSettings                      = new SettingsViewModel();
            InteractionViewModel             = new InteractionViewModel();
            SelectedItemsPropertiesViewModel = new SelectedItemsPropertiesViewModel();
            DirectoryPropertiesViewModel     = new DirectoryPropertiesViewModel();
        }
Beispiel #2
0
        public App()
        {
            this.InitializeComponent();
            exceptionDialog          = new Dialogs.ExceptionDialog();
            this.Suspending         += OnSuspending;
            this.UnhandledException += App_UnhandledException;

            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));

            Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            if (localSettings.Values["theme"] == null)
            {
                localSettings.Values["theme"] = "Default";
            }

            if (localSettings.Values["datetimeformat"] == null)
            {
                localSettings.Values["datetimeformat"] = "Application";
            }

            if (localSettings.Values["theme"] != null)
            {
                if (localSettings.Values["theme"].ToString() == "Light")
                {
                    SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Light;
                    //Debug.WriteLine("Theme Requested as Light");
                }
                else if (localSettings.Values["theme"].ToString() == "Dark")
                {
                    SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Dark;
                    //Debug.WriteLine("Theme Requested as Dark");
                }
                else
                {
                    var uiSettings = new Windows.UI.ViewManagement.UISettings();
                    var color      = uiSettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.Background);
                    if (color == Colors.White)
                    {
                        SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Light;
                        // Debug.WriteLine("Theme Requested as Default (Light)");
                    }
                    else
                    {
                        SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Dark;
                        //Debug.WriteLine("Theme Requested as Default (Dark)");
                    }
                }
            }

            this.RequestedTheme = SettingsPages.Personalization.TV.ThemeValue;
            //Debug.WriteLine("!!Requested Theme!!" + RequestedTheme.ToString());
        }
Beispiel #3
0
        public App()
        {
            var args = Environment.GetCommandLineArgs();

            if (args.Length == 2)
            {
                var parsedCommands = CommandLineParser.ParseUntrustedCommands(args);

                if (parsedCommands != null && parsedCommands.Count > 0)
                {
                    foreach (var command in parsedCommands)
                    {
                        switch (command.Type)
                        {
                        case ParsedCommandType.ExplorerShellCommand:
                            var proc = Process.GetCurrentProcess();
                            OpenShellCommandInExplorer(command.Payload, proc.Id).GetAwaiter().GetResult();

                            //this is useless.
                            Exit();
                            return;

                        default:
                            break;
                        }
                    }
                }
            }

            InitializeComponent();
            Suspending += OnSuspending;

            // Initialize NLog
            Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            NLog.LogManager.Configuration.Variables["LogPath"] = storageFolder.Path;

            RegisterUncaughtExceptionLogger();

            ConsentDialogDisplay    = new Dialogs.ConsentDialog();
            PropertiesDialogDisplay = new Dialogs.PropertiesDialog();
            LayoutDialogDisplay     = new Dialogs.LayoutDialog();
            AddItemDialogDisplay    = new Dialogs.AddItemDialog();
            ExceptionDialogDisplay  = new Dialogs.ExceptionDialog();
            // this.UnhandledException += App_UnhandledException;
            Clipboard.ContentChanged += Clipboard_ContentChanged;
            Clipboard_ContentChanged(null, null);
            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));

            AppSettings                     = new SettingsViewModel();
            InteractionViewModel            = new InteractionViewModel();
            SelectedItemPropertiesViewModel = new SelectedItemPropertiesViewModel();
        }
Beispiel #4
0
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;
            consentDialog    = new Dialogs.ConsentDialog();
            propertiesDialog = new Dialogs.PropertiesDialog();
            layoutDialog     = new Dialogs.LayoutDialog();
            addItemDialog    = new Dialogs.AddItemDialog();
            exceptionDialog  = new Dialogs.ExceptionDialog();
            //this.UnhandledException += App_UnhandledException;
            Clipboard.ContentChanged += Clipboard_ContentChanged;
            Clipboard_ContentChanged(null, null);
            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));

            AppSettings = new SettingsViewModel();
        }
Beispiel #5
0
 public App()
 {
     this.InitializeComponent();
     this.Suspending += OnSuspending;
     consentDialog    = new Dialogs.ConsentDialog();
     propertiesDialog = new Dialogs.PropertiesDialog();
     layoutDialog     = new Dialogs.LayoutDialog();
     addItemDialog    = new Dialogs.AddItemDialog();
     exceptionDialog  = new Dialogs.ExceptionDialog();
     //this.UnhandledException += App_UnhandledException;
     Clipboard.ContentChanged += Clipboard_ContentChanged;
     Clipboard_ContentChanged(null, null);
     AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));
     localSettings = ApplicationData.Current.LocalSettings;
     SetPropertiesFromLocalSettings();
     DetectCustomLocations();
     PopulatePinnedSidebarItems();
     DetectWSLDistros();
     QuickLookIntegration();
 }
Beispiel #6
0
        public App()
        {
            this.InitializeComponent();
            this.Suspending += OnSuspending;

            // Initialize NLog
            Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            NLog.LogManager.Configuration.Variables["LogPath"] = storageFolder.Path;

            RegisterUncaughtExceptionLogger();

            consentDialog    = new Dialogs.ConsentDialog();
            propertiesDialog = new Dialogs.PropertiesDialog();
            layoutDialog     = new Dialogs.LayoutDialog();
            addItemDialog    = new Dialogs.AddItemDialog();
            exceptionDialog  = new Dialogs.ExceptionDialog();
            // this.UnhandledException += App_UnhandledException;
            Clipboard.ContentChanged += Clipboard_ContentChanged;
            Clipboard_ContentChanged(null, null);
            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));

            AppSettings = new SettingsViewModel();
        }
Beispiel #7
0
        public App()
        {
            InitializeComponent();
            Suspending        += OnSuspending;
            LeavingBackground += OnLeavingBackground;
            // Initialize NLog
            Windows.Storage.StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
            NLog.LogManager.Configuration.Variables["LogPath"] = storageFolder.Path;

            RegisterUncaughtExceptionLogger();

            ConsentDialogDisplay    = new Dialogs.ConsentDialog();
            PropertiesDialogDisplay = new Dialogs.PropertiesDialog();
            LayoutDialogDisplay     = new Dialogs.LayoutDialog();
            AddItemDialogDisplay    = new Dialogs.AddItemDialog();
            ExceptionDialogDisplay  = new Dialogs.ExceptionDialog();

            Clipboard.ContentChanged += Clipboard_ContentChanged;
            Clipboard_ContentChanged(null, null);

#if !DEBUG
            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));
#endif
        }
Beispiel #8
0
        public App()
        {
            this.InitializeComponent();
            exceptionDialog          = new Dialogs.ExceptionDialog();
            this.Suspending         += OnSuspending;
            this.UnhandledException += App_UnhandledException;

            AppCenter.Start("682666d1-51d3-4e4a-93d0-d028d43baaa0", typeof(Analytics), typeof(Crashes));

            Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            if (localSettings.Values["theme"] == null)
            {
                localSettings.Values["theme"] = "Default";
            }

            if (localSettings.Values["datetimeformat"] == null)
            {
                localSettings.Values["datetimeformat"] = "Application";
            }

            if (localSettings.Values["theme"] != null)
            {
                if (localSettings.Values["theme"].ToString() == "Light")
                {
                    SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Light;
                }
                else if (localSettings.Values["theme"].ToString() == "Dark")
                {
                    SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Dark;
                }
                else
                {
                    var uiSettings = new Windows.UI.ViewManagement.UISettings();
                    var color      = uiSettings.GetColorValue(Windows.UI.ViewManagement.UIColorType.Background);
                    if (color == Colors.White)
                    {
                        SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Light;
                    }
                    else
                    {
                        SettingsPages.Personalization.TV.ThemeValue = ApplicationTheme.Dark;
                    }
                }
            }

            this.RequestedTheme = SettingsPages.Personalization.TV.ThemeValue;

            if (localSettings.Values["FavoritesDisplayed_Start"] == null)
            {
                localSettings.Values["FavoritesDisplayed_Start"] = true;
            }

            if (localSettings.Values["RecentsDisplayed_Start"] == null)
            {
                localSettings.Values["RecentsDisplayed_Start"] = true;
            }

            if (localSettings.Values["DrivesDisplayed_Start"] == null)
            {
                localSettings.Values["DrivesDisplayed_Start"] = false;
            }

            if (localSettings.Values["FavoritesDisplayed_NewTab"] == null)
            {
                localSettings.Values["FavoritesDisplayed_NewTab"] = true;
            }

            if (localSettings.Values["RecentsDisplayed_NewTab"] == null)
            {
                localSettings.Values["RecentsDisplayed_NewTab"] = true;
            }

            if (localSettings.Values["DrivesDisplayed_NewTab"] == null)
            {
                localSettings.Values["DrivesDisplayed_NewTab"] = false;
            }

            PopulatePinnedSidebarItems();
        }