internal CodeTypeReference GetCodeDomType() { return(new CodeTypeReference(DscResourceTypes.GetClrType(Type))); }
internal string GetClrType() { return(DscResourceTypes.Convert(Type)); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { _reader = reader; DscResourcePropertyCollection collection = new DscResourcePropertyCollection(); while (Read()) { if (CurrentTokenType == JsonToken.StartObject) { DscResourceProperty property = new DscResourceProperty(); while (Read()) { if (CurrentTokenType == JsonToken.PropertyName) { string name = CurrentValue.ToString(); switch (name) { case "name": { property.Name = ReadString(); break; } case "description": { property.Description = ReadString(); break; } case "attribute": { string attributeValue = ReadString(); property.Attribute = DscResourceAttributes.Parse(attributeValue); break; } case "type": { string typeValue = ReadString(); property.Type = DscResourceTypes.Parse(typeValue); break; } case "possibleValues": { List <string> list = new List <string>(); while (Read()) { if (CurrentTokenType == JsonToken.String) { list.Add(CurrentValue.ToString()); } if (CurrentTokenType == JsonToken.EndArray) { break; } } property.PossibleValues = list; break; } } } if (CurrentTokenType == JsonToken.EndObject) { break; } } collection.Add(property); } if (CurrentTokenType == JsonToken.EndArray) { break; } } return(collection); }