ToSic.SexyContent.Internal.DnnStuffToRefactor.EnsurePortalIsConfigured C# (CSharp) Method

EnsurePortalIsConfigured() public method

Returns true if the Portal HomeDirectory Contains the 2sxc Folder and this folder contains the web.config and a Content folder
public EnsurePortalIsConfigured ( SxcInstance sxc, HttpServerUtility server, string controlPath ) : void
sxc SxcInstance
server System.Web.HttpServerUtility
controlPath string
return void
        public void EnsurePortalIsConfigured(SxcInstance sxc, HttpServerUtility server, string controlPath)
        {
            var sexyFolder = new DirectoryInfo(server.MapPath(Path.Combine(sxc.AppPortalSettings.HomeDirectory, Settings.TemplateFolder)));
            var contentFolder = new DirectoryInfo(Path.Combine(sexyFolder.FullName, Constants.ContentAppName));
            var webConfigTemplate = new FileInfo(Path.Combine(sexyFolder.FullName, Settings.WebConfigFileName));
            if (!(sexyFolder.Exists && webConfigTemplate.Exists && contentFolder.Exists))
            {
                // configure it
                var tm = new TemplateManager(sxc.App);
                tm.EnsureTemplateFolderExists(Settings.TemplateLocations.PortalFileSystem);
            };
        }