Esempio n. 1
0
        /// <summary>
        ///     Attach application information from the AssemblyInfo given the Assembly = Assembly.GetExecutingAssembly().
        /// </summary>
        /// <returns></returns>
        public static string GetApplicationNameHtml(bool isForce = false)
        {
            //styleStart = "style='",
            //colorRed = "color:red",
            //styleJoiner = ";",
            //quoteClose = "'";
            var component = Assembly.GetExecutingAssembly();

            if (Assembly != null && (_applicationMailFooter == "" || isForce))
            {
                string str        = "",
                       divStart   = "<div",
                       slashClose = ">",
                       divClose   = "</div>";
                str += divStart + " style='background:#5D5A5A;color:white" + _commonStyles + slashClose;

                str += divStart + slashClose;
                str += "Application Title : ";
                str += GetBold(GetAssemblyAttribute <AssemblyTitleAttribute>(Assembly, a => a.Title));
                str += divClose;

                str += divStart + slashClose;
                str += "Application Name : ";
                str += GetBold(Assembly.FullName);
                str += divClose;

                str += divStart + slashClose;
                str += "Application Location : ";
                str += Assembly.Location;
                str += divClose;

                str += divStart + slashClose;
                str += "Application Version : ";
                str += Assembly.GetName().Version;
                str += divClose;

                str += divClose;

                str += divStart + " style='background: #9CB0C5; color: white" + _commonStyles + slashClose;

                str += divStart + slashClose;
                str += "Component Name : ";
                str += GetBold(GetAssemblyAttribute <AssemblyTitleAttribute>(a => a.Title));
                str += divClose;

                str += divStart + slashClose;
                str += "Component Developed Company Name: ";
                str += GetAssemblyAttribute <AssemblyCompanyAttribute>(a => a.Company);
                str += divClose;

                str += divStart + slashClose;
                str += "Component Trademark: ";
                str += GetBold(GetAssemblyAttribute <AssemblyTrademarkAttribute>(a => a.Trademark));
                str += divClose;

                str += divStart + slashClose;
                str += "Component Developer's Email: ";
                str += "<a href='mailto:[email protected]'>[email protected]</a>";
                str += divClose;

                str += divStart + slashClose;
                str += "Documentation: ";
                str += "<a href='https://github.com/aukgit/DevMVCComponent'>https://github.com/aukgit/DevMVCComponent</a>";
                str += divClose;

                str += divStart + slashClose;
                str += "GetBaseOrAppDirectory : ";
                str += DirectoryExtension.GetBaseOrAppDirectory();
                str += divClose;

                str += divStart + slashClose;
                str += "GetApplicationPhysicalPath : ";
                str += DirectoryExtension.GetApplicationPhysicalPath();
                str += divClose;

                str += divStart + slashClose;
                str += "GetWebAppDirectory(\"~/\") : ";
                str += DirectoryExtension.GetWebAppDirectory("~/");
                str += divClose;

                str += divStart + slashClose;
                str += "GetWebAppDireGetWebAppRootDirectoryctory : ";
                str += DirectoryExtension.GetWebAppRootDirectory();
                str += divClose;

                str += divStart + slashClose;
                str += "GetAppDomainAppPath : ";
                str += DirectoryExtension.GetAppDomainAppPath();
                str += divClose;

                str += divStart + slashClose;
                str += "Component Location : ";
                str += component.Location;
                str += divClose;

                str += divStart + slashClose;
                str += "Component Version : ";
                str += component.GetName().Version;
                str += divClose;

                str += divClose;

                _applicationMailFooter = str;
                return(_applicationMailFooter);
            }

            return(_applicationMailFooter);
        }