protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            // Code that runs on application startup
            IRegistry registry = RegistryFactory.GetRegistry();

            registry.Register <Module>();
        }
Exemple #2
0
        public void Start()
        {
            var registry = RegistryFactory.GetRegistry();

            foreach (var reg in registryModels)
            {
                var registryValue = registry.GetValue(reg);
                if (string.IsNullOrEmpty(registryValue))
                {
                    logger.Info($"Unable to get \"{reg.SubKey}\\{reg.Key}\".");
                    continue;
                }
                logger.Info($"Found \"{reg.SubKey}\\{reg.Key}\": \"{registryValue}\"");
                if (registry.SetValue(reg))
                {
                    registryValue = registry.GetValue(reg);
                    logger.Info($"Updated \"{reg.SubKey}\\{reg.Key}\": \"{registryValue}\"");
                }
                else
                {
                    logger.Warn("Unable to update, make sure the registry is available and you are running the process in admin mode.");
                }
            }
        }
Exemple #3
0
 protected T Resolve <T>()
 {
     return(RegistryFactory.GetRegistry().Resolve <T>());
 }