Пример #1
0
        public PluginProvider(Common.IServiceProvider serviceProvider, IOutputManager errorReporter)
        {
            _serviceProvider = serviceProvider;
            _factory         = _serviceProvider.Get <IPluginFactory>();

            _plugins = new Dictionary <Guid, Plugin>();
        }
Пример #2
0
        /// <summary>
        /// Reinitializes static state.
        /// </summary>
        /// <remarks>This is non-private only to facilitate unit testing.
        /// This should not be called by product code.</remarks>
        /// <param name="reader">An environment variable reader.</param>
        /// <param name="pluginDiscoverer">A lazy plugin discoverer.</param>
        /// <param name="pluginFactory">A plugin factory.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="reader" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="pluginDiscoverer" />
        /// is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="pluginFactory" />
        /// is <c>null</c>.</exception>
        public void Reinitialize(IEnvironmentVariableReader reader,
            Lazy<IPluginDiscoverer> pluginDiscoverer,
            IPluginFactory pluginFactory)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            if (pluginDiscoverer == null)
            {
                throw new ArgumentNullException(nameof(pluginDiscoverer));
            }

            if (pluginFactory == null)
            {
                throw new ArgumentNullException(nameof(pluginFactory));
            }

            EnvironmentVariableReader = reader;
            _rawPluginPaths = reader.GetEnvironmentVariable(_pluginPathsEnvironmentVariable);

            var requestTimeoutInSeconds = reader.GetEnvironmentVariable(_pluginRequestTimeoutEnvironmentVariable);

            _requestTimeout = GetRequestTimeout(requestTimeoutInSeconds);
            _discoverer = pluginDiscoverer;
            _pluginFactory = pluginFactory;
            _pluginOperationClaims = new ConcurrentDictionary<PluginPackageSourceKey, Lazy<Task<IReadOnlyList<OperationClaim>>>>();
            _pluginUtilities = new ConcurrentDictionary<string, Lazy<IPluginMulticlientUtilities>>(
                StringComparer.OrdinalIgnoreCase);
        }
Пример #3
0
 public ClaimController(ApplicationUserManager userManager,
                        IProjectRepository projectRepository,
                        IProjectService projectService,
                        IClaimService claimService,
                        IPlotRepository plotRepository,
                        IClaimsRepository claimsRepository,
                        IFinanceService financeService,
                        IExportDataService exportDataService,
                        IPluginFactory pluginFactory,
                        ICharacterRepository characterRepository,
                        IUriService uriService,
                        IAccommodationRequestRepository accommodationRequestRepository,
                        IAccommodationRepository accommodationRepository,
                        IAccommodationService accommodationService,
                        IAccommodationInviteService accommodationInviteService,
                        IAccommodationInviteRepository accommodationInviteRepository)
     : base(userManager, projectRepository, projectService, exportDataService)
 {
     _claimService     = claimService;
     _plotRepository   = plotRepository;
     _claimsRepository = claimsRepository;
     _accommodationRequestRepository = accommodationRequestRepository;
     _accommodationRepository        = accommodationRepository;
     AccommodationService            = accommodationService;
     AccommodationInviteService      = accommodationInviteService;
     AccommodationInviteRepository   = accommodationInviteRepository;
     FinanceService      = financeService;
     PluginFactory       = pluginFactory;
     CharacterRepository = characterRepository;
     UriService          = uriService;
 }
Пример #4
0
        /// <summary>
        /// Reinitializes static state.
        /// </summary>
        /// <remarks>This is non-private only to facilitate unit testing.
        /// This should not be called by product code.</remarks>
        /// <param name="reader">An environment variable reader.</param>
        /// <param name="pluginDiscoverer">A lazy plugin discoverer.</param>
        /// <param name="pluginFactoryCreator">A plugin factory creator.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="reader" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="pluginDiscoverer" />
        /// is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="pluginFactoryCreator" />
        /// is <c>null</c>.</exception>
        public void Reinitialize(IEnvironmentVariableReader reader,
                                 Lazy <IPluginDiscoverer> pluginDiscoverer,
                                 Func <TimeSpan, IPluginFactory> pluginFactoryCreator)
        {
            if (reader == null)
            {
                throw new ArgumentNullException(nameof(reader));
            }

            if (pluginDiscoverer == null)
            {
                throw new ArgumentNullException(nameof(pluginDiscoverer));
            }

            if (pluginFactoryCreator == null)
            {
                throw new ArgumentNullException(nameof(pluginFactoryCreator));
            }

            EnvironmentVariableReader = reader;
            _rawPluginPaths           = reader.GetEnvironmentVariable(_pluginPathsEnvironmentVariable);

            _connectionOptions = ConnectionOptions.CreateDefault(reader);

            var idleTimeoutInSeconds = EnvironmentVariableReader.GetEnvironmentVariable(_idleTimeoutEnvironmentVariable);
            var idleTimeout          = TimeoutUtilities.GetTimeout(idleTimeoutInSeconds, PluginConstants.IdleTimeout);

            _discoverer            = pluginDiscoverer;
            _pluginFactory         = pluginFactoryCreator(idleTimeout);
            _pluginOperationClaims = new ConcurrentDictionary <PluginPackageSourceKey, Lazy <Task <IReadOnlyList <OperationClaim> > > >();
            _pluginUtilities       = new ConcurrentDictionary <string, Lazy <IPluginMulticlientUtilities> >(
                StringComparer.OrdinalIgnoreCase);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginsViewModel" /> class.
        /// </summary>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="pluginFactory">The plugin factory.</param>
        public PluginsViewModel(
            ISettingsService settingsService,
            IVisualStudioService visualStudioService,
            IPluginFactory pluginFactory)
            : base(settingsService)
        {
            TraceService.WriteLine("PluginsViewModel::Constructor Start");

            this.settingsService = settingsService;
            this.visualStudioService = visualStudioService;

            Plugins allPlugins = pluginFactory.GetPlugins(this.settingsService.MvvmCrossPluginsUri);

            this.corePlugins = this.GetPlugins(allPlugins, false);
            this.communityPlugins = this.GetPlugins(allPlugins, true);

            if (this.corePlugins.Any() == false &&
                this.communityPlugins.Any())
            {
                this.CommunityPluginsSelected = true;
            }
            else
            {
                this.CorePluginsSelected = true;
            }

            TraceService.WriteLine("PluginsViewModel::Constructor End");
        }
Пример #6
0
 /// <summary>
 /// Loads the attribute defined plugins on the assembly.
 /// </summary>
 /// <param name="assembly">The assembly that contains the attributes.</param>
 /// <param name="repository">The repository to add the plugins to.</param>
 /// <exception cref="T:System.ArgumentNullException">
 /// <para><paramref name="assembly" /> is <see langword="null" />.</para>
 /// <para>-or-</para>
 /// <para><paramref name="repository" /> is <see langword="null" />.</para>
 /// </exception>
 private void LoadPlugins(Assembly assembly, ILoggerRepository repository)
 {
     if ((object)assembly == null)
     {
         throw new ArgumentNullException("assembly");
     }
     if (repository == null)
     {
         throw new ArgumentNullException("repository");
     }
     object[] array = assembly.GetCustomAttributes(typeof(PluginAttribute)).ToArray();
     if (array != null && array.Length != 0)
     {
         object[] array2 = array;
         for (int i = 0; i < array2.Length; i++)
         {
             IPluginFactory pluginFactory = (IPluginFactory)array2[i];
             try
             {
                 repository.PluginMap.Add(pluginFactory.CreatePlugin());
             }
             catch (Exception exception)
             {
                 LogLog.Error(declaringType, "Failed to create plugin. Attribute [" + pluginFactory.ToString() + "]", exception);
             }
         }
     }
 }
Пример #7
0
 public PrintController(ApplicationUserManager userManager, IProjectRepository projectRepository,
                        IProjectService projectService, IExportDataService exportDataService, IPlotRepository plotRepository,
                        IPluginFactory pluginFactory) : base(userManager, projectRepository, projectService, exportDataService)
 {
     PlotRepository = plotRepository;
     PluginFactory  = pluginFactory;
 }
Пример #8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PluginsViewModel" /> class.
        /// </summary>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="visualStudioService">The visual studio service.</param>
        /// <param name="pluginFactory">The plugin factory.</param>
        public PluginsViewModel(
            ISettingsService settingsService,
            IVisualStudioService visualStudioService,
            IPluginFactory pluginFactory)
            : base(settingsService)
        {
            TraceService.WriteLine("PluginsViewModel::Constructor Start");

            this.settingsService     = settingsService;
            this.visualStudioService = visualStudioService;

            Plugins allPlugins = pluginFactory.GetPlugins(this.settingsService.MvvmCrossPluginsUri);

            this.corePlugins      = this.GetPlugins(allPlugins, false);
            this.communityPlugins = this.GetPlugins(allPlugins, true);

            if (this.corePlugins.Any() == false &&
                this.communityPlugins.Any())
            {
                this.CommunityPluginsSelected = true;
            }
            else
            {
                this.CorePluginsSelected = true;
            }

            TraceService.WriteLine("PluginsViewModel::Constructor End");
        }
Пример #9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SqlExportBuilder"/> class.
        /// </summary>
        /// <param name="settingsRepository">The current repository.</param>
        /// <param name="pluginFactory">The plugin factory.</param>
        /// <exception cref="System.ArgumentNullException">
        /// repository
        /// or
        /// pluginFactory are null.
        /// </exception>
        public SqlExportBuilder(ISettingsRepository settingsRepository, IUserRepository userRepository, IPageRepository pageRepository, IPluginFactory pluginFactory)
        {
            if (settingsRepository == null)
            {
                throw new ArgumentNullException(nameof(settingsRepository));
            }

            if (userRepository == null)
            {
                throw new ArgumentNullException(nameof(userRepository));
            }

            if (pageRepository == null)
            {
                throw new ArgumentNullException(nameof(pageRepository));
            }

            if (pluginFactory == null)
            {
                throw new ArgumentNullException(nameof(pluginFactory));
            }

            _settingsRepository = settingsRepository;
            _userRepository     = userRepository;
            _pageRepository     = pageRepository;
            _pluginFactory      = pluginFactory;

            IncludePages         = true;
            IncludeConfiguration = true;
        }
Пример #10
0
		/// <summary>
		/// Creates a new markdown parser which handles the image and link parsing by the various different 
		/// markdown format parsers.
		/// </summary>
		/// <returns>An <see cref="IMarkupParser"/> for Creole,Markdown or Media wiki formats.</returns>
		public MarkupConverter(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository,  IPluginFactory pluginFactory)
		{
			_externalLinkPrefixes = new List<string>()
			{
				"http://",
				"https://",
				"www.",
				"mailto:",
				"#",
				"tag:"
			};

			_pluginFactory = pluginFactory;
			_settingsRepository = settingsRepository;
			_pageRepository = pageRepository;
			_applicationSettings = settings;

			// Create the UrlResolver for all wiki urls
			HttpContextBase httpContext = null;
			if (HttpContext.Current != null)
				httpContext = new HttpContextWrapper(HttpContext.Current);

			UrlResolver = new UrlResolver(httpContext);		
	
			if (!_applicationSettings.Installed)
			{
				// Skip the chain of creation, as the markup converter isn't needed but is created by
				// StructureMap - this is required for installation
				return;
			}

			CreateParserForMarkupType();
		}
Пример #11
0
 public InjectionConfigurationViewModelFactory(
     DomainActionBuilder actionBuilder,
     ComponentViewModelFactory componentViewModelFactory,
     IFindFirstLaunchTimeQuery findFirstLaunchTimeQuery,
     IFindGamePackageByIdQuery findGamePackageByIdQuery,
     IFindGamesQuery findGamesQuery,
     IFindLastEditedGamePackageQuery findLastEditedGamePackageQuery,
     IDirectoryPicker directoryPicker,
     IEqualityComparer <ProxySettings> stateEqualityComparer,
     IEventPublisher eventPublisher,
     IFilePicker filePicker,
     IPluginFactory pluginFactory,
     INavigationService navigationService,
     ITaskRunner runner)
 {
     _actionBuilder                  = actionBuilder;
     _componentViewModelFactory      = componentViewModelFactory;
     _findFirstLaunchTimeQuery       = findFirstLaunchTimeQuery;
     _findGamePackageByIdQuery       = findGamePackageByIdQuery;
     _findGamesQuery                 = findGamesQuery;
     _findLastEditedGamePackageQuery = findLastEditedGamePackageQuery;
     _directoryPicker                = directoryPicker;
     _stateEqualityComparer          = stateEqualityComparer;
     _eventPublisher                 = eventPublisher;
     _filePicker        = filePicker;
     _pluginFactory     = pluginFactory;
     _navigationService = navigationService;
     _runner            = runner;
 }
Пример #12
0
		public WikiExporter(ApplicationSettings applicationSettings, PageService pageService, ISettingsRepository settingsRepository, IPageRepository pageRepository, IUserRepository userRepository, IPluginFactory pluginFactory)
		{
			if (applicationSettings == null)
				throw new ArgumentNullException(nameof(applicationSettings));

			if (pageService == null)
				throw new ArgumentNullException(nameof(pageService));

			if (settingsRepository == null)
				throw new ArgumentNullException(nameof(settingsRepository));

			if (pageRepository == null)
				throw new ArgumentNullException(nameof(pageRepository));

			if (userRepository == null)
				throw new ArgumentNullException(nameof(userRepository));

			if (pluginFactory == null)
				throw new ArgumentNullException(nameof(pluginFactory));

			_applicationSettings = applicationSettings;
			_pageService = pageService;
			_sqlExportBuilder = new SqlExportBuilder(settingsRepository, userRepository, pageRepository, pluginFactory);

			ExportFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data", "Export");
		}
Пример #13
0
        private void Initialize(IEnvironmentVariableReader reader,
                                Lazy <IPluginDiscoverer> pluginDiscoverer,
                                Func <TimeSpan, IPluginFactory> pluginFactoryCreator,
                                Lazy <string> pluginsCacheDirectoryPath)
        {
            EnvironmentVariableReader = reader ?? throw new ArgumentNullException(nameof(reader));
            _discoverer = pluginDiscoverer ?? throw new ArgumentNullException(nameof(pluginDiscoverer));
            _pluginsCacheDirectoryPath = pluginsCacheDirectoryPath ?? throw new ArgumentNullException(nameof(pluginsCacheDirectoryPath));

            if (pluginFactoryCreator == null)
            {
                throw new ArgumentNullException(nameof(pluginFactoryCreator));
            }
#if IS_DESKTOP
            _rawPluginPaths = reader.GetEnvironmentVariable(EnvironmentVariableConstants.DesktopPluginPaths);
#else
            _rawPluginPaths = reader.GetEnvironmentVariable(EnvironmentVariableConstants.CorePluginPaths);
#endif
            if (string.IsNullOrEmpty(_rawPluginPaths))
            {
                _rawPluginPaths = reader.GetEnvironmentVariable(EnvironmentVariableConstants.PluginPaths);
            }

            _connectionOptions = ConnectionOptions.CreateDefault(reader);

            var idleTimeoutInSeconds = EnvironmentVariableReader.GetEnvironmentVariable(EnvironmentVariableConstants.IdleTimeout);
            var idleTimeout          = TimeoutUtilities.GetTimeout(idleTimeoutInSeconds, PluginConstants.IdleTimeout);

            _pluginFactory         = pluginFactoryCreator(idleTimeout);
            _pluginOperationClaims = new ConcurrentDictionary <PluginRequestKey, Lazy <Task <IReadOnlyList <OperationClaim> > > >();
            _pluginUtilities       = new ConcurrentDictionary <string, Lazy <IPluginMulticlientUtilities> >(
                StringComparer.OrdinalIgnoreCase);
        }
Пример #14
0
 public ClaimController(
     IProjectRepository projectRepository,
     IProjectService projectService,
     IClaimService claimService,
     IPlotRepository plotRepository,
     IClaimsRepository claimsRepository,
     IFinanceService financeService,
     IPluginFactory pluginFactory,
     ICharacterRepository characterRepository,
     IUriService uriService,
     IAccommodationRequestRepository accommodationRequestRepository,
     IAccommodationRepository accommodationRepository,
     IAccommodationInviteService accommodationInviteService,
     IAccommodationInviteRepository accommodationInviteRepository,
     IUserRepository userRepository)
     : base(projectRepository, projectService, userRepository)
 {
     _claimService     = claimService;
     _plotRepository   = plotRepository;
     _claimsRepository = claimsRepository;
     _accommodationRequestRepository = accommodationRequestRepository;
     _accommodationRepository        = accommodationRepository;
     AccommodationInviteService      = accommodationInviteService;
     AccommodationInviteRepository   = accommodationInviteRepository;
     FinanceService      = financeService;
     PluginFactory       = pluginFactory;
     CharacterRepository = characterRepository;
     UriService          = uriService;
 }
Пример #15
0
 public ExecuteResultAction([NotNull] IPluginFactory pluginFactory)
 {
     if (pluginFactory == null)
     {
         throw new ArgumentNullException(nameof(pluginFactory));
     }
     _pluginFactory = pluginFactory;
 }
Пример #16
0
 public CommandInvoker(IPluginFactory factory)
 {
     if (factory == null)
     {
         throw new ArgumentNullException("factory");
     }
     this.PluginFactory = factory;
 }
Пример #17
0
 public PageHistoryService(ApplicationSettings settings, IRepository repository, IUserContext context,
                           PageViewModelCache pageViewModelCache, IPluginFactory pluginFactory)
     : base(settings, repository)
 {
     _markupConverter    = new MarkupConverter(settings, repository, pluginFactory);
     _context            = context;
     _pageViewModelCache = pageViewModelCache;
 }
Пример #18
0
		public PageHistoryService(ApplicationSettings settings, IRepository repository, IUserContext context,
			PageViewModelCache pageViewModelCache, IPluginFactory pluginFactory)
			: base(settings, repository)
		{
			_markupConverter = new MarkupConverter(settings, repository, pluginFactory);
			_context = context;
			_pageViewModelCache = pageViewModelCache;
		}
Пример #19
0
        public TextPluginRunner(IPluginFactory pluginFactory)
        {
            if (pluginFactory == null)
                throw new ArgumentNullException("pluginFactory");

            _pluginFactory = pluginFactory;
            _plugins = GetPlugins();
        }
 public ExecuteResultAction([NotNull] IPluginFactory pluginFactory)
 {
     if (pluginFactory == null)
     {
         throw new ArgumentNullException(nameof(pluginFactory));
     }
     _pluginFactory = pluginFactory;
 }
Пример #21
0
        /// <summary>
        /// Initializes a new instance of the
        /// <see cref="PluginPipelineFactory"/> class.
        /// </summary>
        /// <param name="factory">The <see cref="IPluginFactory"/> used
        /// to convert individual algorithms into plugins.</param>
        /// <exception cref="ArgumentNullException">factory is null</exception>
        public PluginPipelineFactory(IPluginFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            _factory = factory;
        }
Пример #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ProcessBuilder"/>
        /// class.
        /// </summary>
        /// <param name="factory">The <see cref="IPluginFactory"/> used to
        /// resolve plugins.</param>
        /// <exception cref="ArgumentNullException">factory is null.</exception>
        public ProcessBuilder(IPluginFactory factory)
        {
            if (factory == null)
            {
                throw new ArgumentNullException("factory");
            }

            _factory = factory;
        }
Пример #23
0
 public DatacardStorage(IDatacardPath datacardPath, IDatacardWriter writer, IDatacardExtractor extractor, IPluginFactory pluginFactory, IFileSystem fileSystem, ISerializer serializer)
 {
     _datacardPath  = datacardPath;
     _writer        = writer;
     _extractor     = extractor;
     _pluginFactory = pluginFactory;
     _fileSystem    = fileSystem;
     _serializer    = serializer;
 }
Пример #24
0
 public PluginSetupController(
     IPluginFactory pluginFactory,
     IProjectRepository projectRepository,
     IProjectService projectService,
     IUserRepository userRepository)
     : base(projectRepository, projectService, userRepository)
 {
     PluginFactory = pluginFactory;
 }
Пример #25
0
 public static PluginOperationData <T> GetOperationInstance <T>([NotNull] this IPluginFactory self, Project project, string plugin)
     where T : IPluginOperation
 {
     if (self == null)
     {
         throw new ArgumentNullException(nameof(self));
     }
     return(self.GetProjectOperations <T>(project).SingleOrDefault(p => p.OperationName == plugin));
 }
Пример #26
0
 public PluginSetupController(ApplicationUserManager userManager,
                              IPluginFactory pluginFactory,
                              IProjectRepository projectRepository,
                              IProjectService projectService,
                              IExportDataService exportDataService,
                              IUserRepository userRepository)
     : base(userManager, projectRepository, projectService, exportDataService, userRepository)
 {
     PluginFactory = pluginFactory;
 }
Пример #27
0
        public PageHistoryService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, IUserContext context,
                                  PageViewModelCache pageViewModelCache, IPluginFactory pluginFactory)
        {
            _markupConverter    = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
            _context            = context;
            _pageViewModelCache = pageViewModelCache;

            SettingsRepository = settingsRepository;
            PageRepository     = pageRepository;
        }
        public TextPluginRunner(IPluginFactory pluginFactory)
        {
            if (pluginFactory == null)
            {
                throw new ArgumentNullException("pluginFactory");
            }

            _pluginFactory = pluginFactory;
            _plugins       = GetPlugins();
        }
Пример #29
0
		public PageHistoryService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, IUserContext context, 
			PageViewModelCache pageViewModelCache, IPluginFactory pluginFactory)
		{
			_markupConverter = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
			_context = context;
			_pageViewModelCache = pageViewModelCache;

			SettingsRepository = settingsRepository;
			PageRepository = pageRepository;
		}
        public override Instance ReadChildInstance(string name, IPluginFactory graph, Type childType)
        {
            ITypeReader<XmlNode> reader = TypeReaderFactory.GetReader(childType);
            if (reader == null)
            {
                return base.ReadChildInstance(name, graph, childType);
            }

            XmlElement element = _element[name];
            return element == null ? null : reader.Read(element, childType);
        }
 /// <summary>
 ///     Initializes a new instance of the <see cref="NugetPackagesBaseViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 protected NugetPackagesBaseViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
 {
     this.settingsService = settingsService;
     this.pluginsService = pluginsService;
     this.projectFactory = projectFactory;
     this.pluginFactory = pluginFactory;
 }
Пример #32
0
 public PrintController(ApplicationUserManager userManager, IProjectRepository projectRepository,
                        IProjectService projectService, IExportDataService exportDataService,
                        IPlotRepository plotRepository,
                        IPluginFactory pluginFactory, ICharacterRepository characterRepository, IUriService uriService) : base(userManager,
                                                                                                                               projectRepository, projectService, exportDataService)
 {
     PlotRepository      = plotRepository;
     PluginFactory       = pluginFactory;
     CharacterRepository = characterRepository;
     UriService          = uriService;
 }
Пример #33
0
		public PluginSettingsController(ApplicationSettings settings, UserServiceBase userService, IUserContext context, 
			SettingsService settingsService, IPluginFactory pluginFactory, IRepository repository, SiteCache siteCache, 
			PageViewModelCache viewModelCache, ListCache listCache)
			: base (settings, userService, context, settingsService)
		{
			_pluginFactory = pluginFactory;
			_repository = repository;
			_siteCache = siteCache;
			_viewModelCache = viewModelCache;
			_listCache = listCache;
		}
 /// <summary>
 ///     Initializes a new instance of the <see cref="NugetPackagesBaseViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 protected NugetPackagesBaseViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
 {
     this.settingsService = settingsService;
     this.pluginsService  = pluginsService;
     this.projectFactory  = projectFactory;
     this.pluginFactory   = pluginFactory;
 }
Пример #35
0
 public PluginSettingsController(ApplicationSettings settings, UserServiceBase userService, IUserContext context,
                                 SettingsService settingsService, IPluginFactory pluginFactory, ISettingsRepository settingsRepository, SiteCache siteCache,
                                 PageViewModelCache viewModelCache, ListCache listCache)
     : base(settings, userService, context, settingsService)
 {
     _pluginFactory      = pluginFactory;
     _settingsRepository = settingsRepository;
     _siteCache          = siteCache;
     _viewModelCache     = viewModelCache;
     _listCache          = listCache;
 }
Пример #36
0
 public static void RegisterPluginFactory(string name, IPluginFactory factory, bool loadOnInit)
 {
     if (!_pluginFactories.ContainsKey(name))
     {
         _pluginFactories[name] = factory;
         if (loadOnInit)
         {
             _loadOnInitialization.Add(name);
         }
     }
 }
Пример #37
0
        public SearchService(ApplicationSettings settings, IRepository repository, IPluginFactory pluginFactory, IUserContext context
                             , Security.UserServiceBase UserService
                             )
            : base(settings, repository)
        {
            _context         = context;
            _markupConverter = new MarkupConverter(settings, repository, pluginFactory);
            IndexPath        = settings.SearchIndexPath;

            _UserService = UserService;
        }
Пример #38
0
        public LogController(IPluginFactory outputFactory, ILogger <LogController> logger, IConfiguration configuration)
        {
            _logger = logger;

            _logger.SLT00003_Debug_LogController_Start();
            _outputFactory = outputFactory;
            _config        = new TransportConfiguration();

            configuration?.GetSection("Transport")?.Bind(_config);
            _logger.SLT00002_Debug_LogController_End();
        }
Пример #39
0
 public ClaimController(ApplicationUserManager userManager, IProjectRepository projectRepository,
                        IProjectService projectService, IClaimService claimService, IPlotRepository plotRepository,
                        IClaimsRepository claimsRepository, IFinanceService financeService, IExportDataService exportDataService, IPluginFactory pluginFactory)
     : base(userManager, projectRepository, projectService, exportDataService)
 {
     _claimService     = claimService;
     _plotRepository   = plotRepository;
     _claimsRepository = claimsRepository;
     FinanceService    = financeService;
     PluginFactory     = pluginFactory;
 }
        public DataFlow(IProgress <DataFlowStatus> progress,
                        IDataFlowFacade <IBaseTable, IPlugin, ILink> dataFlowFacade,
                        IPluginFactory pluginExecutableFactory)
        {
            this.progress       = progress;
            this.dataFlowFacade = dataFlowFacade;
            this.pluginFactory  = pluginExecutableFactory;
            this.dataFlowStatus = new DataFlowStatus();
            this.nodeProgress   = new NodeStateChangeProgress();

            this.nodeProgress.ProgressChanged += NodeProgress_ProgressChanged;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PluginsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 public PluginsViewModel(
     ISettingsService settingsService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
     : base(settingsService,
         pluginsService,
         projectFactory,
         pluginFactory)
 {
     this.settingsService = settingsService;
 }
Пример #42
0
		public ToolsController(ApplicationSettings settings, UserServiceBase userManager,
			SettingsService settingsService, PageService pageService, SearchService searchService, IUserContext context,
			ListCache listCache, PageViewModelCache pageViewModelCache, IWikiImporter wikiImporter, IPluginFactory pluginFactory, WikiExporter wikiExporter)
			: base(settings, userManager, context, settingsService) 
		{
			_pageService = pageService;
			_searchService = searchService;
			_listCache = listCache;
			_pageViewModelCache = pageViewModelCache;
			_wikiImporter = wikiImporter;			
			_wikiExporter = wikiExporter;
		}
        /// <summary>
        /// Initializes a new instance of the <see cref="XamarinFormsLabsViewModel" /> class.
        /// </summary>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="pluginsService">The plugins service.</param>
        /// <param name="pluginFactory">The plugin factory.</param>
        public XamarinFormsLabsViewModel(
            ISettingsService settingsService,
            IPluginsService pluginsService,
            IPluginFactory pluginFactory)
        {
            TraceService.WriteLine("XamarinFormsLabsViewModel::Constructor Start");

            this.settingsService = settingsService;
            this.pluginsService = pluginsService;
            this.pluginFactory = pluginFactory;

            TraceService.WriteLine("XamarinFormsLabsViewModel::Constructor End");
        }
Пример #44
0
        public WikiExporter(ApplicationSettings applicationSettings, PageService pageService, IRepository repository, IPluginFactory pluginFactory)
        {
            if (applicationSettings == null)
                throw new ArgumentNullException("applicationSettings");

            if (pageService == null)
                throw new ArgumentNullException("pageService");

            _applicationSettings = applicationSettings;
            _pageService = pageService;
            _sqlExportBuilder = new SqlExportBuilder(repository, pluginFactory);

            ExportFolder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "App_Data", "Export");
        }
Пример #45
0
 public RelService(ApplicationSettings settings, IRepository repository, SearchService searchService,
     PageHistoryService historyService, IUserContext context,
     ListCache listCache, PageViewModelCache pageViewModelCache, SiteCache sitecache, IPluginFactory pluginFactory)
     : base(settings, repository)
 {
     _searchService = searchService;
     _markupConverter = new MarkupConverter(settings, repository, pluginFactory);
     _historyService = historyService;
     _context = context;
     _listCache = listCache;
     _pageViewModelCache = pageViewModelCache;
     _siteCache = sitecache;
     _pluginFactory = pluginFactory;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ApplicationSamplesOptionsViewModel" /> class.
 /// </summary>
 /// <param name="settingsService">The settings service.</param>
 /// <param name="cachingService">The caching service.</param>
 /// <param name="pluginsService">The plugins service.</param>
 /// <param name="projectFactory">The project factory.</param>
 /// <param name="pluginFactory">The plugin factory.</param>
 public ApplicationSamplesOptionsViewModel(
     ISettingsService settingsService,
     ICachingService cachingService,
     IPluginsService pluginsService,
     IProjectFactory projectFactory,
     IPluginFactory pluginFactory)
     : base(settingsService,
      pluginsService,
      projectFactory,
      pluginFactory)
 {
     this.settingsService = settingsService;
     this.cachingService = cachingService;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="NugetPackagesViewModel" /> class.
        /// </summary>
        /// <param name="applicationService">The application service.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="pluginsService">The plugins service.</param>
        /// <param name="pluginFactory">The plugin factory.</param>
        public NugetPackagesViewModel(
            IApplicationService applicationService,
            ISettingsService settingsService,
            IPluginsService pluginsService,
            IPluginFactory pluginFactory)
        {
            TraceService.WriteLine("NugetServicesViewModel::Constructor Start");

            this.applicationService = applicationService;
            this.settingsService = settingsService;
            this.pluginsService = pluginsService;
            this.pluginFactory = pluginFactory;

            TraceService.WriteLine("NugetServicesViewModel::Constructor End");
        }
 public MainCommandsFactory(
     [NotNull] IPluginFactory pluginFactory,
     [NotNull] PluginCompilationEngine compilationEngine)
 {
     if (pluginFactory == null)
     {
         throw new ArgumentNullException(nameof(pluginFactory));
     }
     if (compilationEngine == null)
     {
         throw new ArgumentNullException(nameof(compilationEngine));
     }
     _pluginFactory = pluginFactory;
     _compilationEngine = compilationEngine;
 }
Пример #49
0
		public UserManagementController(ApplicationSettings settings, UserServiceBase userManager,
			SettingsService settingsService, PageService pageService, SearchService searchService, IUserContext context,
			ListCache listCache, PageViewModelCache pageViewModelCache, SiteCache siteCache, IWikiImporter wikiImporter, 
			IRepository repository, IPluginFactory pluginFactory)
			: base(settings, userManager, context, settingsService) 
		{
			_settingsService = settingsService;
			_pageService = pageService;
			_searchService = searchService;
			_listCache = listCache;
			_pageViewModelCache = pageViewModelCache;
			_siteCache = siteCache;
			_wikiImporter = wikiImporter;			
			_repository = repository;
			_pluginFactory = pluginFactory;
		}
Пример #50
0
		public PageService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, SearchService searchService, 
			PageHistoryService historyService, IUserContext context, 
			ListCache listCache, PageViewModelCache pageViewModelCache, SiteCache sitecache, IPluginFactory pluginFactory)
		{
			_searchService = searchService;
			_markupConverter = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
			_historyService = historyService;
			_context = context;
			_listCache = listCache;
			_pageViewModelCache = pageViewModelCache;
			_siteCache = sitecache;
			_pluginFactory = pluginFactory;
			_markupLinkUpdater = new MarkupLinkUpdater(_markupConverter.Parser);

			ApplicationSettings = settings;
			SettingsRepository = settingsRepository;
			PageRepository = pageRepository;
		}
		/// <summary>
		/// Searches for plugins in the specified path, and loads
		/// any plugins that are found into a registry.
		/// </summary>
		/// <param name="p_pftFactory">The factory to use to create <see cref="Plugin"/>s.</param>
		/// <param name="p_pdvDiscoverer">The discoverer to use to search for plugins.</param>
		/// <returns>A registry containing all of the discovered plugin formats.</returns>
		public static PluginRegistry DiscoverManagedPlugins(IPluginFactory p_pftFactory, IPluginDiscoverer p_pdvDiscoverer)
		{
			Trace.TraceInformation("Discovering Managed Plugins...");
			Trace.Indent();

			PluginRegistry pgrRegistry = new PluginRegistry(p_pftFactory);
            if (p_pdvDiscoverer != null)
			    foreach (string strPlugin in p_pdvDiscoverer.FindPlugins())
			    {
				    Trace.TraceInformation("Found: {0}", strPlugin);
				    if (pgrRegistry.RegisterPlugin(strPlugin))
				    {
					    Trace.Indent();
					    Trace.TraceInformation("Registered.");
					    Trace.Unindent();
				    }
			    }
			Trace.Unindent();
			return pgrRegistry;
		}
Пример #52
0
		public SearchService(ApplicationSettings settings, ISettingsRepository settingsRepository, IPageRepository pageRepository, IPluginFactory pluginFactory)
		{
			if (settings == null)
				throw new ArgumentNullException(nameof(settings));

			if (settingsRepository == null)
				throw new ArgumentNullException(nameof(settingsRepository));

			if (pageRepository == null)
				throw new ArgumentNullException(nameof(pageRepository));

			if (pluginFactory == null)
				throw new ArgumentNullException(nameof(pluginFactory));

			_markupConverter = new MarkupConverter(settings, settingsRepository, pageRepository, pluginFactory);
			IndexPath = settings.SearchIndexPath;

			ApplicationSettings = settings;
			SettingsRepository = settingsRepository;
			PageRepository = pageRepository;
		}
Пример #53
0
		/// <summary>
		/// Creates a new markdown parser which handles the image and link parsing by the various different 
		/// markdown format parsers.
		/// </summary>
		/// <returns>An <see cref="IMarkupParser"/> for Creole,Markdown or Media wiki formats.</returns>
		public MarkupConverter(ApplicationSettings settings, IRepository repository, IPluginFactory pluginFactory)
		{
			_externalLinkPrefixes = new List<string>()
			{
				"http://",
				"https://",
				"www.",
				"mailto:",
				"#",
				"tag:"
			};

			_pluginFactory = pluginFactory;
			_repository = repository;
			_applicationSettings = settings;

			// Create the UrlResolver for all wiki urls
			HttpContextBase httpContext = null;
			if (HttpContext.Current != null)
				httpContext = new HttpContextWrapper(HttpContext.Current);

			UrlResolver = new UrlResolver(httpContext);		
	
			if (!_applicationSettings.Installed || _applicationSettings.UpgradeRequired)
			{
				string warnMessage = "Roadkill is not installed, or an upgrade is pending (ApplicationSettings.UpgradeRequired = false)." +
									"Skipping initialization of MarkupConverter (MarkupConverter.Parser will now be null)";

				Log.Warn(warnMessage);

				// Skip the chain of creation, as the markup converter isn't needed
				return;
			}

			CreateParserForMarkupType();
		}
		/// <summary>
		/// A simple constructor that initializes the object with its dependencies.
		/// </summary>
		/// <param name="p_pgfPluginFactory">The factory to use to create plugins.</param>
		public PluginRegistry(IPluginFactory p_pgfPluginFactory)
		{
			PluginFactory = p_pgfPluginFactory;
			RegisteredPlugins = new ReadOnlyObservableList<Plugin>(m_ostRegisteredPlugins);
		}
Пример #55
0
        public SpecialPagesController(ApplicationSettings settings, UserServiceBase userManager, IUserContext context, 
			SettingsService settingsService, IPluginFactory pluginFactory)
            : base(settings, userManager, context, settingsService)
        {
            _pluginFactory = pluginFactory;
        }
Пример #56
0
        public ConstructorInstance ToInstance(IPluginFactory factory, Type pluginType)
        {
            var plugin = factory.PluginFor(PluggedType());

            var instance = new ConstructorInstance(plugin);
            if (InstanceKey.IsNotEmpty())
            {
                instance.Name = InstanceKey;
            }

            var reader = new InstanceMementoPropertyReader(instance, this, factory);
            plugin.VisitArguments(reader);

            return instance;
        }
Пример #57
0
        protected virtual Instance readInstance(IPluginFactory pluginFactory, Type pluginType)
        {
            if (IsDefault)
            {
                return new DefaultInstance();
            }

            if (IsReference)
            {
                return new ReferencedInstance(ReferenceKey);
            }

            return ToInstance(pluginFactory, pluginType);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ServicesService" /> class.
        /// </summary>
        /// <param name="codeConfigFactory">The code config factory.</param>
        /// <param name="codeSnippetFactory">The code snippet factory.</param>
        /// <param name="settingsService">The settings service.</param>
        /// <param name="messageBoxService">The message box service.</param>
        /// <param name="nugetService">The nuget service.</param>
        /// <param name="pluginFactory">The plugin factory.</param>
        public ServicesService(
            ICodeConfigFactory codeConfigFactory,
            ICodeSnippetFactory codeSnippetFactory,
            ISettingsService settingsService,
            IMessageBoxService messageBoxService,
            INugetService nugetService,
            IPluginFactory pluginFactory)
        {
            TraceService.WriteLine("ServicesService::Constructor");

            this.codeConfigFactory = codeConfigFactory;
            this.settingsService = settingsService;
            this.messageBoxService = messageBoxService;
            this.nugetService = nugetService;
            this.pluginFactory = pluginFactory;
            this.codeSnippetFactory = codeSnippetFactory;

            this.Init();
        }
Пример #59
0
		public SearchServiceMock(ApplicationSettings settings, IRepository repository, IPluginFactory pluginFactory)
			: base(settings, repository, pluginFactory)
		{
			Pages = new List<Page>();
			PageContents = new List<PageContent>();
		}
 public DiscoveryWorker(IPluginFactory pluginFactory)
 {
     PluginFactory = pluginFactory;
 }