Exemple #1
0
 public WebConfiguration(NamespaceMapper namespaceMapper)
 {
     Assets = new AssetsConfiguration();
     ScriptsToInclude = new ScriptsToInclude();
     PathsToNamespaces = new PathToNamespaceMappers();
     NamespaceMapper = namespaceMapper;
 }
Exemple #2
0
 public WebConfiguration(NamespaceMapper namespaceMapper)
 {
     Assets            = new AssetsConfiguration();
     ScriptsToInclude  = new ScriptsToInclude();
     PathsToNamespaces = new PathToNamespaceMappers();
     NamespaceMapper   = namespaceMapper;
 }
        public static FunctionBody WithNamespaceMappersFrom(this FunctionBody global, PathToNamespaceMappers namespaceMappers)
        {
            foreach( var map in namespaceMappers.Maps ) {
                global.Access("namespaceMapper",
                    a => a.WithFunctionCall(
                        f => f.WithName("addMapping").WithParameters("\"" + map.Key + "\"", "\"" + map.Value + "\"")));
            }

            return global;
        }
Exemple #4
0
        public WebConfiguration(
            NamespaceMapper namespaceMapper
            )
        {
            Assets            = new AssetsConfiguration();
            ScriptsToInclude  = new ScriptsToInclude();
            PathsToNamespaces = new PathToNamespaceMappers();
            NamespaceMapper   = namespaceMapper;

#if (NET461)
            ApplicationPhysicalPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
#endif
        }
        public WebConfiguration(
            NamespaceMapper namespaceMapper
            )
        {
            Assets            = new AssetsConfiguration();
            ScriptsToInclude  = new ScriptsToInclude();
            PathsToNamespaces = new PathToNamespaceMappers();
            NamespaceMapper   = namespaceMapper;

#if (NET461)
            ApplicationPhysicalPath = System.Web.Hosting.HostingEnvironment.ApplicationPhysicalPath;
#else
            // Todo: Temporary hack!!! Use ContentRoot in IHostingEnvironment
            ApplicationPhysicalPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot");
#endif
        }
        public static FunctionBody WithNamespaceMappersFrom(this FunctionBody global, PathToNamespaceMappers namespaceMappers)
        {
            foreach (var map in namespaceMappers.Maps)
            {
                global.Access("namespaceMapper",
                              a => a.WithFunctionCall(
                                  f => f.WithName("addMapping").WithParameters("\"" + map.Key + "\"", "\"" + map.Value + "\"")));
            }

            return(global);
        }