Example #1
0
        public MainViewModel(
            [NotNull] IRecentFileListPersister persister,
            [NotNull] IEventAggregator aggregator,
            [NotNull] IWindowManager windowManager,
            [NotNull] IPreferencesSerializer preferencesSerializer)
        {
            if (persister == null)
            {
                throw new ArgumentNullException(nameof(persister));
            }
            if (aggregator == null)
            {
                throw new ArgumentNullException(nameof(aggregator));
            }
            if (windowManager == null)
            {
                throw new ArgumentNullException(nameof(windowManager));
            }
            if (preferencesSerializer == null)
            {
                throw new ArgumentNullException(nameof(preferencesSerializer));
            }

            this.aggregator            = aggregator;
            this.Persister             = persister;
            this.windowManager         = windowManager;
            this.preferencesSerializer = preferencesSerializer;

            aggregator.Subscribe(this);

            DebuggingProfile = new DebuggingProfileViewModel();
            maestro          = new Maestro();
            timer            = new Timer(state => CheckExitedProcesses(), null, TimeSpan.Zero, TimeSpan.FromSeconds(5));
        }
Example #2
0
        private void Load(DebuggingProfileViewModel profile, string filePath)
        {
            DebuggingProfile = profile;
            foreach (var target in profile.Targets)
            {
                target.SetDebuggingEngineSelector(GetAvailableEnginesFromVisualStudio);
            }

            FileName = filePath;
            Error    = "";
            IsDirty  = false;
        }