Пример #1
0
        public App()
        {
            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();
        }
Пример #2
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();
        }