Пример #1
0
 public LiveModelsProvider(ILogger logger, IModelsBuilderConfig config, ModelsGenerator modelGenerator, ModelsGenerationError mbErrors)
 {
     _logger         = logger;
     _config         = config ?? throw new ArgumentNullException(nameof(config));
     _modelGenerator = modelGenerator;
     _mbErrors       = mbErrors;
 }
Пример #2
0
        public PureLiveModelFactory(Lazy <UmbracoServices> umbracoServices, IProfilingLogger logger, IModelsBuilderConfig config)
        {
            _umbracoServices = umbracoServices;
            _logger          = logger;
            _config          = config;
            _errors          = new ModelsGenerationError(config);
            _ver             = 1;  // zero is for when we had no version
            _skipver         = -1; // nothing to skip

            RazorBuildProvider.CodeGenerationStarted += RazorBuildProvider_CodeGenerationStarted;

            if (!HostingEnvironment.IsHosted)
            {
                return;
            }

            var modelsDirectory = _config.ModelsDirectory;

            if (!Directory.Exists(modelsDirectory))
            {
                Directory.CreateDirectory(modelsDirectory);
            }

            // BEWARE! if the watcher is not properly released then for some reason the
            // BuildManager will start confusing types - using a 'registered object' here
            // though we should probably plug into Umbraco's MainDom - which is internal
            HostingEnvironment.RegisterObject(this);
            _watcher                     = new FileSystemWatcher(modelsDirectory);
            _watcher.Changed            += WatcherOnChanged;
            _watcher.EnableRaisingEvents = true;

            // get it here, this need to be fast
            _debugLevel = _config.DebugLevel;
        }
Пример #3
0
 public ModelsBuilderDashboardController(IModelsBuilderConfig config, ModelsGenerator modelsGenerator, OutOfDateModelsStatus outOfDateModels, ModelsGenerationError mbErrors)
 {
     //_umbracoServices = umbracoServices;
     _config          = config;
     _modelGenerator  = modelsGenerator;
     _outOfDateModels = outOfDateModels;
     _mbErrors        = mbErrors;
     _dashboardReport = new DashboardReport(config, outOfDateModels, mbErrors);
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Builder"/> class with a list of models to generate,
        /// the result of code parsing, and a models namespace.
        /// </summary>
        /// <param name="typeModels">The list of models to generate.</param>
        /// <param name="modelsNamespace">The models namespace.</param>
        protected Builder(IModelsBuilderConfig config, IList <TypeModel> typeModels)
        {
            _typeModels = typeModels ?? throw new ArgumentNullException(nameof(typeModels));

            Config = config ?? throw new ArgumentNullException(nameof(config));

            // can be null or empty, we'll manage
            ModelsNamespace = Config.ModelsNamespace;

            // but we want it to prepare
            Prepare();
        }
Пример #5
0
 public ModelsGenerator(UmbracoServices umbracoService, IModelsBuilderConfig config, OutOfDateModelsStatus outOfDateModels)
 {
     _umbracoService  = umbracoService;
     _config          = config;
     _outOfDateModels = outOfDateModels;
 }
Пример #6
0
 public DashboardReport(IModelsBuilderConfig config, OutOfDateModelsStatus outOfDateModels, ModelsGenerationError mbErrors)
 {
     _config          = config;
     _outOfDateModels = outOfDateModels;
     _mbErrors        = mbErrors;
 }
Пример #7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextBuilder"/> class with a list of models to generate
 /// and the result of code parsing.
 /// </summary>
 /// <param name="typeModels">The list of models to generate.</param>
 public TextBuilder(IModelsBuilderConfig config, IList <TypeModel> typeModels)
     : base(config, typeModels)
 {
 }
 public ContentTypeModelValidator(IModelsBuilderConfig config) : base(config)
 {
 }
Пример #9
0
 public ContentTypeModelValidatorBase(IModelsBuilderConfig config)
 {
     _config = config;
 }
Пример #10
0
 public ModelsBuilderComponent(IModelsBuilderConfig config, LiveModelsProvider liveModelsProvider, OutOfDateModelsStatus outOfDateModels)
 {
     _config             = config;
     _liveModelsProvider = liveModelsProvider;
     _outOfDateModels    = outOfDateModels;
 }
Пример #11
0
 public MemberTypeModelValidator(IModelsBuilderConfig config) : base(config)
 {
 }
Пример #12
0
 public OutOfDateModelsStatus(IModelsBuilderConfig config)
 {
     _config = config;
 }
Пример #13
0
 public ModelsGenerationError(IModelsBuilderConfig config)
 {
     _config = config;
 }