Was ist eine äquivalente Methode zu "GetCustomAttributes" für .NETCore (Windows 8 Framework)?

Ich bin die Zusammenstellung einer app, die Schnittstellen mit Stack-API und wurden folgende dieses tutorial (obwohl der alte API-version es noch funktioniert). Mein problem ist, dass wenn diese innerhalb der Windows 8 Store App ich bin contrained durch die .NETCore Framework, das nicht unterstützen das GetCustomAttributes Methode gefunden unter:

    private static IEnumerable<T> ParseJson<T>(string json) where T : class, new()
    {
        var type = typeof (T);
        var attribute = type.GetCustomAttributes(typeof (WrapperObjectAttribute), false).SingleOrDefault() as WrapperObjectAttribute;
        if (attribute == null)
        {
            throw new InvalidOperationException(
                String.Format("{0} type must be decorated with a WrapperObjectAttribute.", type.Name));
        }

        var jobject = JObject.Parse(json);
        var collection = JsonConvert.DeserializeObject<List<T>>(jobject[attribute.WrapperObject].ToString());
        return collection;
    }

Meine Frage ist zwei-Fach. Was genau macht der GetCustomAttributes tun und gibt es ein äquivalent zu dieser Methode innerhalb der Einschränkungen von Windows 8 Store-App Reich?

InformationsquelleAutor der Frage KronoS | 2012-10-10

Schreibe einen Kommentar