Example #1
0
        public BatchRunnerModel(IApplicationProvider appProvider, IRecentFilesManager recentFilesMgr)
        {
            m_AppProvider    = appProvider;
            m_RecentFilesMgr = recentFilesMgr;
            RecentFiles      = new ObservableCollection <string>(m_RecentFilesMgr.RecentFiles);

            InstalledVersions = m_AppProvider.GetInstalledVersions().ToArray();

            if (!InstalledVersions.Any())
            {
                throw new UserMessageException("Failed to detect any installed version of the host application");
            }
        }
Example #2
0
        public BatchRunnerModel(IApplicationProvider appProvider, IRecentFilesManager recentFilesMgr,
                                IMacroFileFilterProvider macroFilterProvider, Func <BatchJob, IBatchRunJobExecutor> execFact)
        {
            m_AppProvider    = appProvider;
            m_RecentFilesMgr = recentFilesMgr;
            RecentFiles      = new ObservableCollection <string>(m_RecentFilesMgr.RecentFiles);

            InputFilesFilter = appProvider.InputFilesFilter;
            MacroFilesFilter = macroFilterProvider.GetSupportedMacros()
                               .Union(new FileFilter[] { FileFilter.AllFiles }).ToArray();

            m_ExecFact = execFact;

            InstalledVersions = m_AppProvider.GetInstalledVersions().ToArray();

            if (!InstalledVersions.Any())
            {
                throw new UserMessageException("Failed to detect any installed version of the host application");
            }
        }