Ejemplo n.º 1
0
    private static void ReadAllowedChildTag(AllowedChildTagDescriptorBuilder builder, JObject childTag, JsonSerializer serializer)
    {
        string name        = childTag["Name"].Value <string>();
        string displayName = childTag["DisplayName"].Value <string>();
        JArray jArray      = childTag["Diagnostics"].Value <JArray>();

        builder.Name        = name;
        builder.DisplayName = displayName;
        foreach (JToken item2 in jArray)
        {
            JsonReader      reader = item2.CreateReader();
            RazorDiagnostic item   = serializer.Deserialize <RazorDiagnostic>(reader);
            builder.Diagnostics.Add(item);
        }
    }
        private void ReadAllowedChildTag(AllowedChildTagDescriptorBuilder builder, JObject childTag, JsonSerializer serializer)
        {
            var name        = childTag[nameof(AllowedChildTagDescriptor.Name)].Value <string>();
            var displayName = childTag[nameof(AllowedChildTagDescriptor.DisplayName)].Value <string>();
            var diagnostics = childTag[nameof(AllowedChildTagDescriptor.Diagnostics)].Value <JArray>();

            builder.Name        = name;
            builder.DisplayName = displayName;

            foreach (var diagnostic in diagnostics)
            {
                var diagnosticReader = diagnostic.CreateReader();
                var diagnosticObject = serializer.Deserialize <RazorDiagnostic>(diagnosticReader);
                builder.Diagnostics.Add(diagnosticObject);
            }
        }