RegisterStringTagProvider() public static method

public static RegisterStringTagProvider ( IStringTagProvider tagProvider ) : void
tagProvider IStringTagProvider
return void
Example #1
0
 /// <summary>
 /// Starts the core services.
 /// This initializes the PropertyService and ResourceService.
 /// </summary>
 public void StartCoreServices()
 {
     if (configDirectory == null)
     {
         configDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                                        applicationName);
     }
     PropertyService.InitializeService(configDirectory,
                                       dataDirectory ?? Path.Combine(FileUtility.ApplicationRootPath, "data"),
                                       propertiesName);
     PropertyService.Load();
     ResourceService.InitializeService(Path.Combine(PropertyService.DataDirectory, "resources"));
     StringParser.RegisterStringTagProvider(new AppNameProvider {
         appName = applicationName
     });
 }
Example #2
0
        /// <summary>
        /// Starts the core services.
        /// This initializes the PropertyService and ResourceService.
        /// </summary>
        public void StartCoreServices(IPropertyService propertyService)
        {
            var container = ServiceSingleton.GetRequiredService <IServiceContainer>();
            var applicationStateInfoService = new ApplicationStateInfoService();

            addInTree = new AddInTreeImpl(applicationStateInfoService);

            container.AddService(typeof(IPropertyService), propertyService);
            container.AddService(typeof(IResourceService), new ResourceServiceImpl(
                                     Path.Combine(propertyService.DataDirectory, "resources"), propertyService));
            container.AddService(typeof(IAddInTree), addInTree);
            container.AddService(typeof(ApplicationStateInfoService), applicationStateInfoService);
            StringParser.RegisterStringTagProvider(new AppNameProvider {
                appName = applicationName
            });
        }