Ejemplo n.º 1
0
        private ScriptKraftBundle ConstructScriptsBundle(KraftGlobalConfigurationSettings kraftGlobalConfigurationSettings, string resFolderPath, string resProfileFileName)
        {
            string resProfilePhysFileName = Path.Combine(resFolderPath, resProfileFileName);

            if (Directory.Exists(resFolderPath) && File.Exists(resProfilePhysFileName))
            {
                ScriptKraftBundle resBundle = new ScriptKraftBundle();
                resBundle.ContentRootPath = kraftGlobalConfigurationSettings.EnvironmentSettings.ContentRootPath;
                //KraftBundle resBundle = new StyleKraftBundle() { ContentRootPath = _KraftEnvironmentSettings.ContentRootPath };
                KraftBundleProfiles resBundleProfile = resBundle as KraftBundleProfiles;
                resBundleProfile.ContentRootPath = kraftGlobalConfigurationSettings.EnvironmentSettings.ContentRootPath;
                if (resBundleProfile != null)
                {
                    resBundleProfile.StartDirPath = resFolderPath;
                    resBundleProfile.ProfileFiles = new List <string> {
                        resProfileFileName
                    };
                    return(resBundle);
                }
            }
            return(null);
        }
Ejemplo n.º 2
0
        private ScriptKraftBundle ConstructScriptsBundle(string rootPath, string resFolderPath, string resProfileFileName)
        {
            string resProfilePhysFileName = Path.Combine(resFolderPath, resProfileFileName);

            if (Directory.Exists(resFolderPath) && File.Exists(resProfilePhysFileName))
            {
                ScriptKraftBundle resBundle = new ScriptKraftBundle
                {
                    ContentRootPath = rootPath
                };
                //KraftBundle resBundle = new StyleKraftBundle() { ContentRootPath = _KraftEnvironmentSettings.ContentRootPath };
                KraftBundleProfiles resBundleProfile = resBundle as KraftBundleProfiles;
                resBundleProfile.ContentRootPath = rootPath;
                if (resBundleProfile != null)
                {
                    resBundleProfile.StartDirPath = resFolderPath;
                    resBundleProfile.ProfileFiles = new List <string> {
                        resProfileFileName, RESOURCEDEPENDENCY_FILE_NAME
                    };                                                                                                    //The default should be last
                    return(resBundle);
                }
            }
            return(null);
        }