Beispiel #1
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");
            }
        }
Beispiel #2
0
        public CommandManagerVM(IToolbarConfigurationProvider confsProvider,
                                ISettingsProvider settsProvider,
                                IMessageService msgService, IIconsProvider[] iconsProviders,
                                IMacroFileFilterProvider macroFilterProvider)
        {
            m_ConfsProvider = confsProvider;
            m_SettsProvider = settsProvider;
            m_MsgService    = msgService;

            m_MacroExtensions = macroFilterProvider.GetSupportedMacros()
                                .Select(f => f.Extensions)
                                .SelectMany(x => x)
                                .Select(x => Path.GetExtension(x))
                                .Distinct(StringComparer.InvariantCultureIgnoreCase)
                                .ToArray();

            m_IconsProviders = iconsProviders;

            Settings = m_SettsProvider.GetSettings();

            LoadCommands();
        }
Beispiel #3
0
 public MacrosVM(IMacroFileFilterProvider fileFilterProvider)
 {
     Macros           = new ObservableCollection <MacroData>();
     MacroFilesFilter = fileFilterProvider.GetSupportedMacros()
                        .Union(new FileFilter[] { FileFilter.AllFiles }).ToArray();
 }