public MessageFactory(
            ICommonServices services,
            ITemplateEngine templateEngine,
            ITemplateManager templateManager,
            IMessageModelProvider modelProvider,
            IMessageTemplateService messageTemplateService,
            IQueuedEmailService queuedEmailService,
            ILanguageService languageService,
            IEmailAccountService emailAccountService,
            EmailAccountSettings emailAccountSettings,
            IDownloadService downloadService)
        {
            _services               = services;
            _templateEngine         = templateEngine;
            _templateManager        = templateManager;
            _modelProvider          = modelProvider;
            _messageTemplateService = messageTemplateService;
            _queuedEmailService     = queuedEmailService;
            _languageService        = languageService;
            _emailAccountService    = emailAccountService;
            _emailAccountSettings   = emailAccountSettings;
            _downloadService        = downloadService;

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Exemple #2
0
        public ExpandableBuilderViewModel(IApplicationLogger logger, ITemplateManager templateManager)
            : base(logger, templateManager)
        {
            Title = "Expandable Builder";

            EnvironmentVariables.AddRange(Environment.GetEnvironmentVariables().Keys.OfType <string>());
        }
Exemple #3
0
        public override void Render(object toRender, Stream output)
        {
            AppContentResponder appContentResponder = ContentResponder.AppContentResponders[AppName];
            ITemplateManager    templateManager     = appContentResponder.AppTemplateManager;
            string templateName    = GetTemplateName(toRender);
            string templates       = templateManager.CombinedCompiledTemplates;
            string renderedContent = DustScript.Render(templates, templateName, toRender);

            byte[] data;
            if (HttpArgs.Has("layout", out string layout))
            {
                string      absolutePath = ExecutionRequest.Request.Url.AbsolutePath;
                string      extension    = Path.GetExtension(absolutePath);
                string      path         = absolutePath.Truncate(extension.Length);
                LayoutModel layoutModel  = appContentResponder.GetLayoutModelForPath(path);
                layoutModel.LayoutName  = layout;
                layoutModel.PageContent = renderedContent;
                MemoryStream ms = new MemoryStream();
                appContentResponder.CommonTemplateManager.RenderLayout(layoutModel, ms);
                ms.Seek(0, SeekOrigin.Begin);
                data = ms.GetBuffer();
            }
            else
            {
                data = Encoding.UTF8.GetBytes(renderedContent);
            }
            output.Write(data, 0, data.Length);
        }
 public TemplateController(ITemplateManager manager, IOptions <AppSettings> settings, IOptions <ConnectionStrings> conStrings)
 {
     _templateManager = manager;
     _appSettings     = settings.Value;
     _conStrings      = conStrings.Value;
     _templateManager.SetConnectionString(_conStrings.DefaultConnection);
 }
        /// <summary>
        /// Sets the resolver used to locate unknown templates.
        /// </summary>
        /// <param name="resolver">The resolver instance to use.</param>
        /// <returns>The current configuration builder.</returns>
        public IConfigurationBuilder ManageUsing(ITemplateManager resolver)
        {
            Contract.Requires(resolver != null);

            _config.TemplateManager = resolver;
            return(this);
        }
 public CustomRazorTemplateManager(ShellSettings shellSettings,
                                   IOrchardServices orchardServices)
 {
     _shellSettings          = shellSettings;
     _orchardServices        = orchardServices;
     _defaultTemplateManager = new DelegateTemplateManager();
 }
Exemple #7
0
 public MessageFactory(
     SmartDbContext db,
     ICommonServices services,
     ITemplateEngine templateEngine,
     ITemplateManager templateManager,
     IMessageModelProvider modelProvider,
     IQueuedEmailService queuedEmailService,
     ILanguageService languageService,
     IEmailAccountService emailAccountService,
     EmailAccountSettings emailAccountSettings,
     IMediaService mediaService,
     IEventPublisher eventPublisher,
     IStoreContext storeContext,
     IWorkContext workContext)
 {
     _db                   = db;
     _services             = services;
     _templateEngine       = templateEngine;
     _templateManager      = templateManager;
     _modelProvider        = modelProvider;
     _queuedEmailService   = queuedEmailService;
     _languageService      = languageService;
     _emailAccountService  = emailAccountService;
     _emailAccountSettings = emailAccountSettings;
     _mediaService         = mediaService;
     _eventPublisher       = eventPublisher;
     _storeContext         = storeContext;
     _workContext          = workContext;
 }
        public ManageTemplateViewmodel(IShellService shellService, ITemplateManager templateMgr)
            : base(shellService)
        {
            _templateMgr = templateMgr;

            InitializeData();
        }
Exemple #9
0
 protected override void UpgradeClass(ITemplateManager templateManager,
                                      SpaceBody spaceBody,
                                      Mapping upgradeMapping)
 {
     spaceBody.gameObject.layer          = LayerHelper.Sun;
     spaceBody.mappingUpgradeSpaceObject = upgradeMapping;
 }
        public ConfiguratorViewModel(IApplicationLogger logger, IEventAggregator events, IApplicationCommands commands,
                                     ITemplateManager templateManager, IDriveDetector driveDetector, IMessageDisplayService messageService,
                                     ElementViewModelFactory elementFactory, IConfiguratorService configurator, IVariableStore variables)
        {
            _logger          = logger;
            _templateManager = templateManager;
            _driveDetector   = driveDetector;
            _messageService  = messageService;
            _elementFactory  = elementFactory;
            _configurator    = configurator;
            _variables       = variables;

            Title = "Configurator";

            events.GetEvent <TemplateSelectedEvent>().Subscribe(OnTemplateSelected);
            events.GetEvent <ScanDrivesCompletedEvent>().Subscribe(OnScanDrivesCompleted);

            ImportCommand = new DelegateCommand(OnImport, () => true);
            commands.ImportCommand.RegisterCommand(ImportCommand);

            PrevPageCommand = new DelegateCommand <PageViewModel>(OnPrevPage, CanPrevPage);
            NextPageCommand = new DelegateCommand <PageViewModel>(OnNextPage, page => true);
            RescanCommand   = new DelegateCommand(OnScanDrives, () => !IsScanning);

            RescanCommand.Execute();
        }
Exemple #11
0
 public Notifier(ITemplateManager templateManager, ITemplateSettings templateSettings, IEmailer emailer, IEmailAddressSettings emailAddressSettings)
 {
     this.templateManager = templateManager;
     this.templateSettings = templateSettings;
     this.emailer = emailer;
     this.emailAddressSettings = emailAddressSettings;
 }
Exemple #12
0
        private void ApplyItemOption(ITemplateManager <ItemOptionTemplate> options, int itemOptionID, int level)
        {
            if (itemOptionID <= 0)
            {
                return;
            }
            var option = options.Get(itemOptionID);
            var data   = option.LevelData[level];

            PAD   += data.IncPAD;
            PDD   += data.IncPDD;
            MAD   += data.IncMAD;
            MDD   += data.IncMDD;
            ACC   += data.IncACC;
            EVA   += data.IncEVA;
            Speed += data.IncSpeed;
            Jump  += data.IncJump;

            Option.PADr += data.IncPADr;
            Option.PDDr += data.IncPDDr;
            Option.MADr += data.IncMADr;
            Option.MDDr += data.IncMDDr;
            Option.ACCr += data.IncACCr;
            Option.EVAr += data.IncEVAr;
        }
Exemple #13
0
        internal string BuildNJangoPage(string workingDirectory, string templateFile, IronPython.Runtime.PythonDictionary pyContext)
        {
            TemplateManagerProvider templateProvider = new TemplateManagerProvider();
            ITemplateManager        manager          = templateProvider.GetNewManager();

            Dictionary <string, object> context = new Dictionary <string, object>();

            foreach (object str in pyContext.Keys)
            {
                context.Add(str.ToString(), pyContext[str]);
            }

            if (File.Exists(workingDirectory + @"\" + templateFile.ToString()))
            {
                TextReader reader = manager.RenderTemplate(
                    workingDirectory + @"\" + templateFile.ToString(),
                    (Dictionary <string, Object>)context);

                return(reader.ReadToEnd());
            }
            else
            {
                return("Template not found");
            }
        }
Exemple #14
0
 public Deployer(ITemplateManager templateManager, IProvisionManager provisioningManager, IHandlerFactory handlerFactory, ITokeniser tokeniser)
 {
     this.templateManger      = templateManager;
     this.provisioningManager = provisioningManager;
     this.handlerFactory      = handlerFactory;
     this.tokeniser           = tokeniser;
 }
 public ContinentManager(ITemplateManager templateManager, FieldManager fieldManager)
 {
     Continents = templateManager
                  .GetAll <ContinentTemplate>()
                  .Select(c => new Continent(templateManager, fieldManager, c))
                  .ToList();
 }
Exemple #16
0
 public Viewer()
 {
     InitializeComponent();
     provider = new TemplateManagerProvider()
         .WithSetting(Constants.EXCEPTION_IF_ERROR, false)
         .WithLoader(new TemplateLoader(templateSource))
         .GetNewManager();
 }
Exemple #17
0
        protected internal void InitializeCommonTemplateRenderer()
        {
            OnCommonTemplateRendererInitializing();

            CommonTemplateManager = new CommonDustRenderer(this);

            OnCommonTemplateRendererInitialized();
        }
Exemple #18
0
 public Viewer()
 {
     InitializeComponent();
     provider = new TemplateManagerProvider()
                .WithSetting(Constants.EXCEPTION_IF_ERROR, false)
                .WithLoader(new TemplateLoader(templateSource))
                .GetNewManager();
 }
 public ContactManager(IExcelFilesManager excelFilesManager, ITemplateManager templateManager,
                       IInventoryManager inventoryManager, ILogger logger)
 {
     _excelFilesManager = excelFilesManager;
     _templateManager   = templateManager;
     _logger            = logger;
     _inventoryManager  = inventoryManager;
 }
Exemple #20
0
        /// <summary>
        /// Initialises the configuration.
        /// </summary>
        /// <param name="config">The core configuration.</param>
        /// <param name="serviceConfig">The service configuration.</param>
        private void InitialiseConfiguration(RazorEngineConfigurationSection config, TemplateServiceConfigurationElement serviceConfig)
        {
            // Set whether we are allowing missing properties on dynamic.
            AllowMissingPropertiesOnDynamic = config.AllowMissingPropertiesOnDynamic;

            // Set whether we load templates with Assembly.Load(byte[]).
            DisableTempFileLocking = config.DisableTempFileLocking;

            // Add the global namespaces.
            AddNamespaces(config.Namespaces);

            // Add the specific namespaces.
            AddNamespaces(serviceConfig.Namespaces);

            // Sets the activator.
            SetActivator(config.ActivatorType);

            // Sets the base template type.
            SetBaseTemplateType(serviceConfig.BaseTemplateType);

            // Sets the compiler service factory.
            SetCompilerServiceFactory(config.CompilerServiceFactoryType);

            Debug = serviceConfig.Debug;

            // Sets the encoded string factory.
            SetEncodedStringFactory(serviceConfig.EncodedStringFactoryType);

            // Sets the reference resolver.
            SetReferenceResolver(config.ReferenceResolverType);

#pragma warning disable 0618 // Backwards Compat.
            // Sets the template resolver.
            SetTemplateResolver(config.TemplateResolverType);

            if (Resolver != null)
            {
                TemplateManager = new WrapperTemplateManager(Resolver);
            }
#pragma warning restore 0618 // Backwards Compat.

            // Sets the template manager.
            SetTemplateManager(config.TemplateManagerType);

            // Set the language.
            Language = serviceConfig.Language;

            // Sets the activator.
            SetActivator(config.ActivatorType);

            // Sets the compiler service factory.
            SetCompilerServiceFactory(config.CompilerServiceFactoryType);

#pragma warning disable 0618 // Backwards Compat.
            // Sets the template resolver.
            SetTemplateResolver(config.TemplateResolverType);
#pragma warning restore 0618 // Backwards Compat.
        }
Exemple #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RazorGenerator" /> class.
 /// </summary>
 /// <param name="templateManager">The template manager.</param>
 public RazorGenerator(ITemplateManager templateManager)
 {
     service = RazorEngineService.Create(new TemplateServiceConfiguration()
     {
         Language             = RazorEngine.Language.CSharp,
         EncodedStringFactory = new RawStringFactory(),
         TemplateManager      = templateManager,
     });
 }
Exemple #22
0
        public WvsContainer(
            IApplicationLifetime appLifetime,
            ICacheClient cache,
            IMessageBus messageBus,
            ILockProvider lockProvider,
            IOptions <WvsContainerOptions> info,
            IDataContextFactory dataContextFactory,
            ITemplateManager templateManager,
            IScriptConversationManager conversationManager
            ) : base(appLifetime, cache, messageBus, info, dataContextFactory)
        {
            _token    = new CancellationTokenSource();
            _services = new List <IService>();

            Info.LoginServices
            .Select(o => new WvsLogin(
                        appLifetime,
                        cache,
                        messageBus,
                        new OptionsWrapper <LoginServiceInfo>(o),
                        dataContextFactory,
                        lockProvider,
                        templateManager
                        ))
            .ForEach(_services.Add);
            Info.GameServices
            .Select(o => new WvsGame(
                        appLifetime,
                        cache,
                        messageBus,
                        new OptionsWrapper <GameServiceInfo>(o),
                        dataContextFactory,
                        templateManager,
                        conversationManager
                        ))
            .ForEach(_services.Add);
            Info.ShopServices
            .Select(o => new WvsShop(
                        appLifetime,
                        cache,
                        messageBus,
                        new OptionsWrapper <ShopServiceInfo>(o),
                        dataContextFactory,
                        templateManager
                        ))
            .ForEach(_services.Add);
            Info.TradeServices
            .Select(o => new WvsTrade(
                        appLifetime,
                        cache,
                        messageBus,
                        new OptionsWrapper <TradeServiceInfo>(o),
                        dataContextFactory,
                        templateManager
                        ))
            .ForEach(_services.Add);
        }
Exemple #23
0
        private void tsmiCreateClrTrigger_Click(object sender, EventArgs e)
        {
            var tf = TemplateManagerFactory.Instance;
            ITemplateManager man = tf.GetCodeTemplateManager();

            Template t = man.GetTemplate("CS.CreateClrTriggerSnippet.cs");

            insertTemplateCode(t);
        }
Exemple #24
0
        private void insertTemplate(string templateKey)
        {
            var tf = TemplateManagerFactory.Instance;
            ITemplateManager man = tf.GetSqlTemplateManager(_lastConnection);

            Template t = man.GetTemplate(templateKey);

            insertTemplateCode(t);
        }
Exemple #25
0
        /// <summary>
        /// Sets the template manager.
        /// </summary>
        /// <param name="templateManagerType">The template manager type.</param>
        private void SetTemplateManager(string templateManagerType)
        {
            var type = GetType(templateManagerType);

            if (type != null)
            {
                TemplateManager = GetInstance <ITemplateManager>(type);
            }
        }
Exemple #26
0
 public ConfiguratorService(IFileService fileService, IVariableStore variables,
                            ITaskCommandFactory commandFactory, ITemplateManager templateManager, IApplicationSettings settings)
 {
     _fileService     = fileService;
     _variables       = variables;
     _commandFactory  = commandFactory;
     _templateManager = templateManager;
     _settings        = settings;
 }
Exemple #27
0
        private void tsmiCSharpAdoSnippet_Click(object sender, EventArgs e)
        {
            var tf = TemplateManagerFactory.Instance;
            ITemplateManager man = tf.GetCodeTemplateManager();

            Template t = man.GetTemplate("CS.AdoCodeSnippet.cs");

            insertTemplateCode(t);
        }
Exemple #28
0
        public TemplatesController(
            IMapper mapper,
            ITemplateManager templateManager) : base()
        {
            _mapper          = mapper;
            _templateManager = templateManager;

            MapExceptionsToStatusCodes();
        }
 public NotificationManager(
     IEmailService emailService,
     ITemplateManager templateManager,
     IWebHostEnvironment webHostEnvironment)
 {
     _emailService       = emailService;
     _templateManager    = templateManager;
     _webHostEnvironment = webHostEnvironment;
 }
 public ProjectHandler(NodeProviderBroker broker, ITemplateDirectory template_manager, List<Tag> tags, List<Filter> filters, string project_directory)
 {
     this.broker = broker;
     TemplateManager = template_manager;
     this.tags = tags;
     this.filters = filters;
     this.project_directory = project_directory;
     template_loader = new TemplateLoader(project_directory);
     parser = InitializeParser();
 }
 /// <summary>
 /// Конструктор.
 /// </summary>
 /// <param name="logger"><see cref="ILogger{TCategoryName}"/>.</param>
 /// <param name="templateManager"><see cref="ITemplateManager"/>.</param>
 /// <param name="emailBodyGenerator"><see cref="IEmailBodyGenerator"/>.</param>
 public EmailMessageFactory(
     ILogger <EmailMessageFactory> logger,
     ITemplateManager templateManager,
     IEmailBodyGenerator emailBodyGenerator
     )
 {
     this.logger             = logger;
     this.templateManager    = templateManager;
     this.emailBodyGenerator = emailBodyGenerator;
 }
        public ContinentManager(ITemplateManager templateManager, FieldManager fieldManager)
        {
            _templateManager = templateManager;
            _fieldManager    = fieldManager;

            Continents = _templateManager
                         .GetAll <ContinentTemplate>()
                         .Select(c => new Continent(c, _fieldManager))
                         .ToList();
        }
Exemple #33
0
 public FieldSetManager(ITemplateManager templateManager, FieldManager fieldManager)
 {
     FieldSets = templateManager
                 .GetAll <FieldSetTemplate>()
                 .Select(f => new FieldSet(f, fieldManager))
                 .ToDictionary(
         f => f.SetTemplate.Name,
         f => f
         );
 }
Exemple #34
0
 public UserAppService(IRepository <User, long> userRepository, IPermissionManager permissionManager, IFileStoreManager fileStoreManager, IUsersAppNotificationsSender usersAppNotificationsSender, UserNotificationManager userNotificationManager, ICinotamMailSender cinotamMailSender, ITemplateManager templateManager)
 {
     _userRepository              = userRepository;
     _permissionManager           = permissionManager;
     _fileStoreManager            = fileStoreManager;
     _usersAppNotificationsSender = usersAppNotificationsSender;
     _userNotificationManager     = userNotificationManager;
     _cinotamMailSender           = cinotamMailSender;
     _templateManager             = templateManager;
 }
 public ProjectHandler(NodeProviderBroker broker, IVsHierarchy hier, string project_directory)
 {
     this.broker = broker;
     template_loader = new TemplateLoader(project_directory);
     type_resolver = new TypeResolver(hier);
     TemplateDirectory = new TemplateDirectory(project_directory);
     parser = new TemplateManagerProvider()
             .WithTags(type_resolver.Tags)
             .WithFilters(type_resolver.Filters)
             .WithSetting(NDjango.Constants.EXCEPTION_IF_ERROR, false)
             .WithLoader(template_loader)
             .GetNewManager();
 }
Exemple #36
0
        private void ValidateSyntaxTree(ITemplateManager manager)
        {
            var template = manager.GetTemplate(Template, new TestTyperesolver(),
                new TypeResolver.ModelDescriptor(new TypeResolver.IDjangoType[]
                    {
                        new TypeResolver.CLRTypeDjangoType("Standard", typeof(EmptyClass))
                    }));

            //the same logic responsible for retriving nodes as in NodeProvider class (DjangoDesigner).
            var nodes = GetNodes(template.Nodes.ToList().ConvertAll
                (node => (INode)node)).FindAll(node =>
                    (node is ICompletionValuesProvider)
                    || (node.NodeType == NodeType.ParsingContext)
                    || (node.ErrorMessage.Message != ""));
            var actualResult = nodes.ConvertAll(
                node =>
                {
                    var valueProvider = node as ICompletionValuesProvider;
                    var values =
                        valueProvider == null ?
                            new List<string>()
                            : valueProvider.Values;
                    var contextValues = new List<string>(values);
                    switch (node.NodeType)
                    {
                        case NodeType.ParsingContext:
                            contextValues.InsertRange(0 ,(node.Context.TagClosures));
                            return new DesignerData(node.Position, node.Length, contextValues.ToArray(), node.ErrorMessage.Severity, node.ErrorMessage.Message);
                        case NodeType.Reference:
                            return new DesignerData(node.Position, node.Length, GetModelValues(node.Context.Model, RecursionDepth).ToArray(), node.ErrorMessage.Severity, node.ErrorMessage.Message);
                        default:
                            return new DesignerData(node.Position, node.Length, new List<string>(values).ToArray(), node.ErrorMessage.Severity, node.ErrorMessage.Message);
                    }
                });

            for (var i = 0; i < actualResult.Count; i++)
            {
                Assert.AreEqual(ResultForDesigner[i].Length, actualResult[i].Length, "Invalid Length");
                Assert.AreEqual(ResultForDesigner[i].Position, actualResult[i].Position, "Invalid Position");
                Assert.AreEqual(ResultForDesigner[i].ErrorMessage, actualResult[i].ErrorMessage, "Invalid ErrorMessage");
                Assert.AreEqual(ResultForDesigner[i].Severity, actualResult[i].Severity, "Invalid Severity");
                Assert.AreEqual(ResultForDesigner[i].Values, actualResult[i].Values, "Invalid Values Array " + i);
            }

            Assert.AreEqual(ResultForDesigner.Count(), actualResult.Count);
        }
Exemple #37
0
 public void Update()
 {
     uint pitemid;
     IVsMultiItemSelect ppMIS;
     IntPtr ppHier,ppSC;
     object directory = "";
     if (ErrorHandler.Succeeded(SelectionService.GetCurrentSelection(out ppHier, out pitemid, out ppMIS, out ppSC)))
     {
         try
         {
             hierarchy = (IVsHierarchy)Marshal.GetObjectForIUnknown(ppHier);
             hierarchy.GetProperty(VSConstants.VSITEMID_ROOT, (int)__VSHPROPID.VSHPROPID_ProjectDir, out directory);
             projectDir = directory.ToString();
         }
         finally
         {
             Marshal.Release(ppHier);
         }
     }
     if (parser == null)
         parser = InitializeParser();
     if (templatesDir == null)
     {
         templatesDir = new TemplateDirectory();
         templatesDir.selectionTracker = SelectionService;
     }
 }
Exemple #38
0
 public DjangoView(NDjango.Interfaces.ITemplateManager iTemplateManager, string viewPath)
 {
     this.iTemplateManager = iTemplateManager;
     this.viewPath = viewPath;
 }
Exemple #39
0
 /// <summary>
 /// Конструктор
 /// </summary>
 /// <param name="connection">Соединение с БД</param>
 /// <param name="templateManager">Менеджер</param>
 public FakeStrategy(IDbConnection connection, ITemplateManager templateManager)
     : base(connection, templateManager)
 {
 }
        /// <summary>
        /// Create a new readonly view (and copy) of the given configuration.
        /// </summary>
        /// <param name="config">the configuration to copy.</param>
        public ReadOnlyTemplateServiceConfiguration(ITemplateServiceConfiguration config)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            _allowMissingPropertiesOnDynamic = config.AllowMissingPropertiesOnDynamic;

            _activator = config.Activator;
            if (_activator == null)
            {
                throw new ArgumentNullException("config", "the configured Activator cannot be null!");
            }

            _baseTemplateType = config.BaseTemplateType;
            // Check if the baseTemplateType is valid.
            if (_baseTemplateType != null && (!typeof(ITemplate).IsAssignableFrom(_baseTemplateType) || typeof(ITemplate) == _baseTemplateType))
            {
                throw new ArgumentOutOfRangeException("config", "the configured BaseTemplateType must implement ITemplate!");
            }
            
            _cachingProvider = config.CachingProvider;
            if (_cachingProvider == null)
            {
                throw new ArgumentNullException("config", "the configured CachingProvider cannot be null!");
            }

#if !RAZOR4
#pragma warning disable 0618 // Backwards Compat.
            _codeInspectors = config.CodeInspectors;
            if (_codeInspectors == null)
            {
                throw new ArgumentNullException("config", "the configured CodeInspectos cannot be null!");
            }
            _codeInspectors = new List<ICodeInspector>(_codeInspectors);
#pragma warning restore 0618 // Backwards Compat.
#endif

            _compilerServiceFactory = config.CompilerServiceFactory;
            if (_compilerServiceFactory == null)
            {
                throw new ArgumentNullException("config", "the configured CompilerServiceFactory cannot be null!");
            }

            _debug = config.Debug;
            _disableTempFileLocking = config.DisableTempFileLocking;
            _encodedStringFactory = config.EncodedStringFactory;
            if (_encodedStringFactory == null)
            {
                throw new ArgumentNullException("config", "the configured EncodedStringFactory cannot be null!");
            }

            _language = config.Language;
            _namespaces = config.Namespaces;
            if (_namespaces == null)
            {
                throw new ArgumentNullException("config", "the configured Namespaces cannot be null!");
            }
            _namespaces = new HashSet<string>(_namespaces);

            _referenceResolver = config.ReferenceResolver;
            if (_referenceResolver == null)
            {
                throw new ArgumentNullException("config", "the configured ReferenceResolver cannot be null!");
            }

#pragma warning disable 0618 // Backwards Compat.
            _resolver = config.Resolver;
            _templateManager = config.TemplateManager;
            if (_templateManager == null)
            {
                if (_resolver != null)
                {
                    _templateManager = new Xml.WrapperTemplateManager(_resolver);
                }
                else
                {
                    throw new ArgumentNullException("config", "the configured TemplateManager and Resolver cannot be null!");
                }
            }
#pragma warning restore 0618 // Backwards Compat.

        }
 public void setup()
 {
     parser = TestHelper.InitializeParser();
 }
Exemple #42
0
 public NDjangoView(string viewPath, ITemplateManager templateManager)
 {
     this.viewPath = viewPath;
     this.templateManager = templateManager;
 }
Exemple #43
0
 /// <summary>
 /// �����������
 /// </summary>
 /// <param name="connection">���������� � ��</param>
 /// <param name="templateManager">��������</param>
 public StrategyBase(IDbConnection connection, ITemplateManager templateManager)
 {
     TemplateManager = templateManager;
     this.connection = connection;
 }
 public RazorEngineSetup(ITemplateManager templateManager)
 {
     this.templateManager = templateManager;
 }
Exemple #45
0
 public NDjangoView(ITemplate template, ITemplateManager templateManager)
 {
     this.template = template;
     this.templateManager = templateManager;
 }