Ejemplo n.º 1
0
        public static String ToApp(IApp app)
        {
            IStaticApp entity = app as IStaticApp;
            String     path   = entity.GetStaticPath();

            if (isDir(path))
            {
                String dir = GetStaticDir(app);
                if (dir == "/")
                {
                    return(string.Format("/default.html"));
                }
                else
                {
                    return(string.Format("/{0}/default.html", dir));
                }
            }
            else
            {
                if (path.StartsWith("/") == false)
                {
                    return("/" + path);
                }

                return(path);
            }
        }
Ejemplo n.º 2
0
        public static String GetStaticDir(IApp app)
        {
            if (app == null)
            {
                throw new ArgumentNullException("app");
            }

            IStaticApp entity = app as IStaticApp;

            if (entity == null)
            {
                return(getDefaultStaticDir(app));
            }

            String staticDir = getDirFromPath(entity.GetStaticPath());

            if (strUtil.IsNullOrEmpty(staticDir))
            {
                return(getDefaultStaticDir(app));
            }

            return(staticDir);
        }