Пример #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);
        }
Пример #2
0
        public string XGetValue(XPropertyInfo xproperty)
        {
            XObject value = xproperty.XGetValue(null);

            return(XConverter.XConvertToString(value));
        }