예제 #1
0
        private void WriteToastArgumentsToSharedMonitoredDirectory(StartupEventArgs e)
        {
            var args = string.Join("", e.Args);

            Logger.Log(LogLevel.Info, $"Started with protocol arguments. Arguments: {args}");
            var base64 = args.Split(UriSchemeRegistration.StringSeparator, StringSplitOptions.RemoveEmptyEntries).Last();

            FileWatchDistributedNotificationReceiver.WriteDistributedNotificationToPath(base64, new PathResolver());
        }
예제 #2
0
// properties *are* initialized within the constructor. However by a method call, which is not correctly recognized by the code analyzer yet.
#pragma warning disable CS8618 // warning about uninitialized non-nullable properties
        public MainViewModel(IViewProvider viewProvider)
#pragma warning restore CS8618
        {
            var pathResolver = new PathResolver();

            _fileWatch = new FileWatchDistributedNotificationReceiver(pathResolver);
            _trayIcon  = new TrayIconHandle();
            _trayIcon.ExitRequested       += TrayIconOnExitRequested;
            _trayIcon.ShowWindowRequested += TrayIconOnShowWindowRequested;
            var dispatcher = new WpfDispatcher();

            _coreSetup = new CoreSetup(pathResolver, _fileWatch, dispatcher);
            _coreSetup.PipelineUpdated += CoreSetup_PipelineUpdated;
            _coreSetup.DistributedNotificationReceived += CoreSetup_DistributedNotificationReceived;
            _configurationApplication = new ConfigurationApplication(_coreSetup.Configuration);
            _configurationApplication.ApplyChanges();
            GlobalErrorLogTarget.ErrorOccured += GlobalErrorLog_ErrorOccurred;
            _popupService   = new PopupService(this, viewProvider);
            _windowSettings = new WindowSettings(pathResolver.WindowSettingsFilePath);
            _updateUrls     = new UpdateUrls();
            Initialize();
        }