コード例 #1
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="config">Конфигурация.</param>
        /// <param name="externals">Внешнее.</param>
        public ModAutomationBaseContext(ModAutomationBaseConfig config, ModAutomationBaseExternals externals)
        {
            Config = config;

            var resourceErrors    = new ModAutomationBaseResourceErrors(externals.ResourceErrorsLocalizer);
            var resourceSuccesses = new ModAutomationBaseResourceSuccesses(externals.ResourceSuccessesLocalizer);

            PartAngular = new ModAutomationBasePartAngularContext(
                Config.Settings.PartAngular,
                new ModAutomationBasePartAngularExternals
            {
                CoreBaseResourceErrors = externals.CoreBaseResourceErrors,
                ResourceErrors         = resourceErrors,
                ResourceSuccesses      = resourceSuccesses
            });

            PartNetCore = new ModAutomationBasePartNetCoreContext(
                Config.Settings.PartNetCore,
                new ModAutomationBasePartNetCoreExternals
            {
                CoreBaseResourceErrors = externals.CoreBaseResourceErrors,
                ResourceErrors         = resourceErrors,
                ResourceSuccesses      = resourceSuccesses
            });

            Resources = new ModAutomationBaseResources(
                externals.ResourceErrorsLocalizer,
                externals.ResourceSuccessesLocalizer
                );
        }
コード例 #2
0
 /// <summary>
 /// Инициализировать контекст.
 /// </summary>
 /// <param name="externals">Внешнее.</param>
 public void InitContext(ModAutomationBaseExternals externals)
 {
     Context = new ModAutomationBaseContext(Config, externals);
 }