Ejemplo n.º 1
0
        public static string GetUrlFriendlyName(INameManager nameManager)
        {
            string raw = null;

            // Try English if English is the default language selection
            if (nameManager.SortNames.DefaultLanguage == ContentLanguageSelection.English)
            {
                raw = nameManager.SortNames.English;
            }

            // Otherwise try Romaji
            if (raw == null)
            {
                raw = nameManager.SortNames.Romaji;
            }

            // Try English again since there was no Romaji name
            if (raw == null)
            {
                raw = nameManager.SortNames.English;
            }

            // No English or Romaji names, return empty.
            if (raw == null)
            {
                return(string.Empty);
            }

            return(GetUrlFriendlyName(raw));
        }
Ejemplo n.º 2
0
        public ComponentDefinition(
            Component component,
            INameManager nameManager,
            IAssetManager assetManager,
            IHtmlHelper htmlHelper,
            IFluentBuilder fluentBuilder,
            IPackage package)
        {
            _component     = component;
            _nameManager   = nameManager;
            _assetManager  = assetManager;
            _htmlHelper    = htmlHelper;
            _fluentBuilder = fluentBuilder;

            _cssDefinitions             = new List <CssDefinition>();
            _lessDefinitions            = new List <LessDefinition>();
            _functionDefinitions        = new List <FunctionDefinition>();
            _headHtmlToRender           = new List <HtmlDefinition>();
            _bodyHtmlToRender           = new List <HtmlDefinition>();
            _initializationHtmlToRender = new List <HtmlDefinition>();

            if (package != null)
            {
                _component.Package = package;
            }
        }
Ejemplo n.º 3
0
 public FileSystemLoader(
     IHostingEnvironment hostingEnvironment,
     INameManager nameManager)
 {
     _hostingEnvironment = hostingEnvironment;
     _nameManager        = nameManager;
 }
Ejemplo n.º 4
0
		public static EntryNameContract GetName(INameManager nameManager, ContentLanguagePreference languagePreference) {

			var primary = nameManager.SortNames[languagePreference];

			return new EntryNameContract(primary, GetAdditionalNames(nameManager.AllValues, primary));

		}
Ejemplo n.º 5
0
        public LayoutDefinition(
            Layout layout,
            INameManager nameManager,
            IHtmlHelper htmlHelper,
            IFluentBuilder fluentBuilder,
            IRegionDependenciesFactory regionDependenciesFactory,
            IComponentDependenciesFactory componentDependenciesFactory,
            IPackage package)
        {
            _layout                       = layout;
            _nameManager                  = nameManager;
            _htmlHelper                   = htmlHelper;
            _fluentBuilder                = fluentBuilder;
            _regionDependenciesFactory    = regionDependenciesFactory;
            _componentDependenciesFactory = componentDependenciesFactory;

            _regionElements   = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);
            _regionLayouts    = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);
            _regionComponents = new Dictionary <string, object>(StringComparer.OrdinalIgnoreCase);

            _cssDefinitions      = new List <CssDefinition>();
            _functionDefinitions = new List <FunctionDefinition>();

            if (package != null)
            {
                _layout.Package = package;
            }
        }
Ejemplo n.º 6
0
        public void Setup()
        {
            Reset();

            _nameManager = new NameManager(
                SetupMock <IFrameworkConfiguration>());
        }
Ejemplo n.º 7
0
 public AdminController(IUserManager userManager, User currentUser, INameManager nameManager, ILogger <AdminController> logger)
 {
     _userManager = userManager;
     _currentUser = currentUser;
     _nameManager = nameManager;
     _logger      = logger;
 }
 public PageDependenciesFactory(
     IRenderContextFactory renderContextFactory,
     IIdManager idManager,
     IAssetManager assetManager,
     INameManager nameManager,
     ICssWriterFactory cssWriterFactory,
     IJavascriptWriterFactory javascriptWriterFactory,
     IDataScopeProviderFactory dataScopeProviderFactory,
     IDataConsumerFactory dataConsumerFactory,
     IDictionaryFactory dictionaryFactory,
     IDataContextBuilderFactory dataContextBuilderFactory,
     IDataCatalog dataCatalog,
     IDataDependencyFactory dataDependencyFactory)
 {
     _renderContextFactory      = renderContextFactory;
     _idManager                 = idManager;
     _assetManager              = assetManager;
     _nameManager               = nameManager;
     _cssWriterFactory          = cssWriterFactory;
     _javascriptWriterFactory   = javascriptWriterFactory;
     _dataScopeProviderFactory  = dataScopeProviderFactory;
     _dataConsumerFactory       = dataConsumerFactory;
     _dictionaryFactory         = dictionaryFactory;
     _dataContextBuilderFactory = dataContextBuilderFactory;
     _dataCatalog               = dataCatalog;
     _dataDependencyFactory     = dataDependencyFactory;
 }
        private FluentBuilder(
            FluentBuilder parent,
            Func <Type, object> factory,
            IPackage packageContext,
            IDataCatalog dataCatalog,
            IDataDependencyFactory dataDependencyFactory,
            IDataSupplierFactory dataSupplierFactory)
        {
            _nameManager           = parent._nameManager;
            _assemblies            = parent._assemblies;
            _types                 = parent._types;
            _packageContext        = packageContext;
            _dataCatalog           = dataCatalog;
            _dataDependencyFactory = dataDependencyFactory;
            _dataSupplierFactory   = dataSupplierFactory;
            _factory               = factory;

            ModuleBuilder       = parent.ModuleBuilder;
            PageBuilder         = parent.PageBuilder;
            LayoutBuilder       = parent.LayoutBuilder;
            RegionBuilder       = parent.RegionBuilder;
            ComponentBuilder    = parent.ComponentBuilder;
            ServiceBuilder      = parent.ServiceBuilder;
            PackageBuilder      = parent.PackageBuilder;
            DataProviderBuilder = parent.DataProviderBuilder;
        }
Ejemplo n.º 10
0
        private LocalizedStringWithIdContract NameOrEmpty(INameManager nameManager, ContentLanguageSelection lang)
        {
            if (nameManager.HasNameForLanguage(lang))
                return new LocalizedStringWithIdContract(nameManager.FirstNameBase(lang));

            return New(lang);
        }
Ejemplo n.º 11
0
        public BasicNameManager(INameManager nameManager)
        {
            ParamIs.NotNull(() => nameManager);

            Names     = nameManager.NamesBase.Select(n => new LocalizedStringWithId(n.Value, n.Language)).ToArray();
            SortNames = new TranslatedString(nameManager.SortNames);
        }
Ejemplo n.º 12
0
        public void Setup()
        {
            Reset();

            _dataProviderDependenciesFactory = SetupMock <IDataProviderDependenciesFactory>();
            _nameManager            = SetupMock <INameManager>();
            _dataCatalog            = SetupMock <IDataCatalog>();
            _dataSupplierFactory    = SetupMock <IDataSupplierFactory>();
            _dataDependencyFactory  = SetupMock <IDataDependencyFactory>();
            _requestRouter          = SetupMock <IRequestRouter>();
            _frameworkConfiguration = SetupMock <IFrameworkConfiguration>();

            _elementConfiguror = new ElementConfiguror(
                _dataSupplierFactory,
                _dataDependencyFactory,
                _nameManager,
                _requestRouter);

            _fluentBuilder = new FluentBuilder(
                _nameManager,
                _dataCatalog,
                _dataProviderDependenciesFactory.DataDependencyFactory,
                _dataProviderDependenciesFactory.DataSupplierFactory,
                _frameworkConfiguration);

            _fluentBuilder.DataProviderBuilder = new DataProviderBuilder(
                _dataProviderDependenciesFactory,
                _elementConfiguror,
                _nameManager,
                _fluentBuilder);
        }
Ejemplo n.º 13
0
 public Index(
     IComponentDependenciesFactory dependencies,
     INameManager nameManager)
     : base(dependencies)
 {
     _nameManager = nameManager;
     PageAreas    = new[] { PageArea.Head, PageArea.Body };
 }
Ejemplo n.º 14
0
 public ServiceDependenciesFactory(
     IRenderContextFactory renderContextFactory,
     IAssetManager assetManager,
     INameManager nameManager)
 {
     _renderContextFactory = renderContextFactory;
     AssetManager          = assetManager;
     NameManager           = nameManager;
 }
 public TemplateBuilder(
     INameManager nameManager,
     IAssetManager assetManager,
     IDataConsumerFactory dataConsumerFactory)
 {
     _nameManager         = nameManager;
     _assetManager        = assetManager;
     _dataConsumerFactory = dataConsumerFactory;
 }
Ejemplo n.º 16
0
 public HomeController(IUserManager userManager, SignInManager <User> signInManager, ILogger <HomeController> logger, INameManager nameManager, IEmailSender emailSender, ISmsSender smsSender)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _logger        = logger;
     _nameManager   = nameManager;
     _emailSender   = emailSender;
     _smsSender     = smsSender;
 }
 public ServiceDependencies(
     IRenderContext renderContext,
     IAssetManager assetManager,
     INameManager nameManager)
 {
     RenderContext = renderContext;
     AssetManager  = assetManager;
     NameManager   = nameManager;
 }
Ejemplo n.º 18
0
 public ListService(
     IDataLayer dataLater,
     ISegmentTestingFramework segmentTestingFramework,
     INameManager nameManager)
 {
     _dataLayer = dataLater;
     _segmentTestingFramework = segmentTestingFramework;
     _nameManager             = nameManager;
 }
Ejemplo n.º 19
0
 public PackageDefinition(
     Runtime.Package package,
     IFluentBuilder builder,
     INameManager nameManager)
 {
     _package     = package;
     _builder     = builder;
     _nameManager = nameManager;
 }
Ejemplo n.º 20
0
        private LocalizedStringWithIdContract NameOrEmpty(INameManager nameManager, ContentLanguageSelection lang)
        {
            if (nameManager.HasNameForLanguage(lang))
            {
                return(new LocalizedStringWithIdContract(nameManager.FirstNameBase(lang)));
            }

            return(New(lang));
        }
Ejemplo n.º 21
0
 public TemplateService(
     IAssetManager assetmanager,
     INameManager nameManager,
     IHtmlWriterFactory htmlWriterFactory,
     IStringBuilderFactory stringBuilderFactory)
 {
     _assetmanager         = assetmanager;
     _nameManager          = nameManager;
     _htmlWriterFactory    = htmlWriterFactory;
     _stringBuilderFactory = stringBuilderFactory;
 }
Ejemplo n.º 22
0
 public BuildEngine(
     IPackageDependenciesFactory packageDependenciesFactory,
     IElementConfiguror elementConfiguror, 
     INameManager nameManager, 
     IDataProviderDependenciesFactory dataProviderDependenciesFactory)
 {
     _packageDependenciesFactory = packageDependenciesFactory;
     _elementConfiguror = elementConfiguror;
     _nameManager = nameManager;
     _dataProviderDependenciesFactory = dataProviderDependenciesFactory;
 }
Ejemplo n.º 23
0
 public PackageBuilder(
     IPackageDependenciesFactory packageDependenciesFactory,
     IElementConfiguror elementConfiguror,
     INameManager nameManager,
     IFluentBuilder fluentBuilder)
 {
     _packageDependenciesFactory = packageDependenciesFactory;
     _elementConfiguror          = elementConfiguror;
     _nameManager   = nameManager;
     _fluentBuilder = fluentBuilder;
 }
 public PackageDefinition(
     IPackage package,
     IFluentBuilder builder,
     INameManager nameManager,
     Func <Type, object> factory)
 {
     _package     = package;
     _builder     = builder;
     _nameManager = nameManager;
     _factory     = factory;
 }
Ejemplo n.º 25
0
 public ElementConfiguror(
     IDataSupplierFactory dataSupplierFactory,
     IDataDependencyFactory dataDependencyFactory,
     INameManager nameManager,
     IRequestRouter requestRouter)
 {
     _dataSupplierFactory   = dataSupplierFactory;
     _dataDependencyFactory = dataDependencyFactory;
     _nameManager           = nameManager;
     _requestRouter         = requestRouter;
 }
Ejemplo n.º 26
0
 public DataProviderBuilder(
     IDataProviderDependenciesFactory dataProviderDependenciesFactory,
     IElementConfiguror elementConfiguror,
     INameManager nameManager,
     IFluentBuilder fluentBuilder)
 {
     _dataProviderDependenciesFactory = dataProviderDependenciesFactory;
     _elementConfiguror = elementConfiguror;
     _nameManager       = nameManager;
     _fluentBuilder     = fluentBuilder;
 }
Ejemplo n.º 27
0
        //    private GuardAgainstNulls nullValidation = new GuardAgainstNulls();
        //Dictionary<string, Guid> TransactionNameSavedTransactions = new Dictionary<string, Guid>();
        //     Dictionary<Guid, Guid> newObjectsSavedTransactions = new Dictionary<Guid, Guid>();


        /// <summary>
        ///   Initializes a new instance of the DynamicPropertyManager class.
        /// </summary>
        /// <param name = "repository"></param>
        public DynamicPropertyManager(IEntityRepository repository, INameManager nameManager, IPersistor Persistor, IPublishService publishService)
        {
            _repository = repository;

            persistor = Persistor;

            this.nameManager = nameManager;

            typeProperties.OnMissing = OnMissingType;

            this.publishService = publishService;
        }
Ejemplo n.º 28
0
        /// <summary>
        ///   Initializes a new instance of the WorkTypeManager class.
        /// </summary>
        /// <param name = "repository"></param>
        public WorkFlowBuilder(IEntityRepository repository, IPersistor Persistor, INameManager nameMgr, IWorkTypeManager worktypeManager, IContainer container)
        {
            _repository = repository;

            persistor = Persistor;

            this.nameMgr = nameMgr;

            this.worktypeManager = worktypeManager;

            this.container = container;
        }
 public ComponentDependenciesFactory(
     IDataConsumerFactory dataConsumerFactory,
     ICssWriterFactory cssWriterFactory,
     IJavascriptWriterFactory javascriptWriterFactory,
     IAssetManager assetManager,
     INameManager nameManager)
 {
     DataConsumerFactory     = dataConsumerFactory;
     CssWriterFactory        = cssWriterFactory;
     JavascriptWriterFactory = javascriptWriterFactory;
     AssetManager            = assetManager;
     NameManager             = nameManager;
 }
 public ServiceBuilder(
     IServiceDependenciesFactory serviceDependenciesFactory,
     IElementConfiguror elementConfiguror,
     IFluentBuilder fluentBuilder,
     IRequestRouter requestRouter,
     INameManager nameManager)
 {
     _serviceDependenciesFactory = serviceDependenciesFactory;
     _elementConfiguror          = elementConfiguror;
     _fluentBuilder = fluentBuilder;
     _requestRouter = requestRouter;
     _nameManager   = nameManager;
 }
Ejemplo n.º 31
0
 public FluentBuilder(
     INameManager nameManager,
     IDataCatalog dataCatalog,
     IDataDependencyFactory dataDependencyFactory,
     IDataSupplierFactory dataSupplierFactory)
 {
     _nameManager           = nameManager;
     _dataCatalog           = dataCatalog;
     _dataDependencyFactory = dataDependencyFactory;
     _dataSupplierFactory   = dataSupplierFactory;
     _assemblies            = new HashSet <string>();
     _types = new HashSet <Type>();
 }
Ejemplo n.º 32
0
        public NameManagerEditContract(INameManager str)
            : this()
        {
            ParamIs.NotNull(() => str);

            EnglishName = NameOrEmpty(str, ContentLanguageSelection.English);
            OriginalName = NameOrEmpty(str, ContentLanguageSelection.Japanese);
            RomajiName = NameOrEmpty(str, ContentLanguageSelection.Romaji);

            Aliases = str.NamesBase
                .Where(n => n.Id != EnglishName.Id && n.Id != OriginalName.Id && n.Id != RomajiName.Id)
                .Select(n => new LocalizedStringWithIdContract(n))
                .ToList();
        }
Ejemplo n.º 33
0
        public NameManagerEditContract(INameManager str)
            : this()
        {
            ParamIs.NotNull(() => str);

            EnglishName  = NameOrEmpty(str, ContentLanguageSelection.English);
            OriginalName = NameOrEmpty(str, ContentLanguageSelection.Japanese);
            RomajiName   = NameOrEmpty(str, ContentLanguageSelection.Romaji);

            Aliases = str.NamesBase
                      .Where(n => n.Id != EnglishName.Id && n.Id != OriginalName.Id && n.Id != RomajiName.Id)
                      .Select(n => new LocalizedStringWithIdContract(n))
                      .ToList();
        }