Exemplo n.º 1
0
        public AssemblyPage(string domain, string name)
        {
            FetchTitle  = () => $"{ (TheAssembly == null ? string.Empty : TheAssembly.ShortName) } 程序集任务定义详情";
            FetchHeader = () => TheAssembly.Title;

            Sidebar = () => SidebarMenus.DomainsMenu(domain);
            var set = StorageService.Provider.GetDomainDefines();

            TheDomain   = set.SingleOrDefault(s => s.Name == domain);
            TheAssembly = TheDomain == null ? null : TheDomain.JobSets.SingleOrDefault(s => s.ShortName == name);
        }
        /// <summary>
        /// JobPage  CreateRoute
        /// </summary>
        public static (string Name, string Link) CreateRoute(this UrlHelper Url, DomainDefine domain, AssemblyDefine assembly, JobDefine job)
        {
            var name = job.Title;
            var link = JobPageRoute.Replace("(?<domain>.+)", domain.Name).Replace("(?<assembly>.+)", assembly.ShortName).Replace("(?<name>.+)", name).EscapeRoute();

            return(name, Url.To(link));
        }
        /// <summary>
        /// AssemblyPage  CreateRoute
        /// </summary>
        public static (string Name, string Link) CreateRoute(this UrlHelper Url, DomainDefine domain, AssemblyDefine assembly)
        {
            var domainName = domain.Name;
            var name       = assembly.Title;
            var link       = AssemblyPageRoute.Replace("(?<domain>.+)", domainName).Replace("(?<name>.+)", name).EscapeRoute();

            return(name, Url.To(link));
        }