public void WritePropertyName(JsonPropertyName propertyName) { if (propertyName is null) { throw new ArgumentNullException(nameof(propertyName)); } WriteStarted(InternalState.PropertyName); WriteUTFBytes(propertyName.GetBytes(Settings.NamingStrategy)); }
static EnumHelper() { foreach (T value in Enum.GetValues(typeof(T))) { var propertyName = JsonPropertyName.GetOrCreate(value.ToString()); s_propertyNames.Add(value, propertyName); s_propertyNamesReversed.Add(propertyName.Value, value); } }
public static void Write(this JsonWriter writer, JsonPropertyName propertyName, UInt32?value) { if (!value.HasValue && !writer.Settings.SerializeNulls) { return; } writer.WritePropertyName(propertyName); writer.WriteValue(value); }
public static void Write <T>(this JsonWriter writer, JsonPropertyName propertyName, T value) { if (value == null && !writer.Settings.SerializeNulls) { return; } writer.WritePropertyName(propertyName); writer.WriteValue(value); }
public static void Write(this JsonWriter writer, JsonPropertyName propertyName, UInt32 value) { writer.WritePropertyName(propertyName); writer.WriteValue(value); }
public static void Write(this JsonWriter writer, JsonPropertyName propertyName, DateTimeOffset value) { writer.WritePropertyName(propertyName); writer.WriteValue(value); }