Example #1
0
        public static Dictionary <string, string> XToAbout(XAssembly assemly, IStringLocalizer xstring)
        {
            Dictionary <string, string> about = new Dictionary <string, string>();

            foreach (XAttribute xattr in assemly.XGetCustomAttributes())
            {
                if (xattr.XGetType().XName.StartsWith("Assembly") && xattr.XGetType().XName.EndsWith("Attribute") && xattr.XGetType().XNamespace == "System.Reflection")
                {
                    string attr = xattr.XGetType().XName;
                    attr = attr.Substring("Assembly".Length);
                    attr = attr.Substring(0, attr.Length - "Attribute".Length);
                    XPropertyInfo xprop = xattr.XGetType().XGetProperty(attr);
                    if (xprop != null && xprop.XIsStatic == false)
                    {
                        string v = _XStringModel.XToString(xprop.XGetValue(xattr), xstring);
                        about[attr] = v;
                    }
                }
            }
            return(about);
        }