示例#1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ClientUiNode" /> class.
 /// </summary>
 /// <param name="attributes">attributes (required).</param>
 /// <param name="group">group (required).</param>
 /// <param name="messages">messages (required).</param>
 /// <param name="meta">meta (required).</param>
 /// <param name="type">type (required).</param>
 public ClientUiNode(ClientUiNodeAttributes attributes = default(ClientUiNodeAttributes), string group = default(string), List <ClientUiText> messages = default(List <ClientUiText>), ClientUiNodeMeta meta = default(ClientUiNodeMeta), string type = default(string))
 {
     // to ensure "attributes" is required (not null)
     if (attributes == null)
     {
         throw new ArgumentNullException("attributes is a required property for ClientUiNode and cannot be null");
     }
     this.Attributes = attributes;
     // to ensure "group" is required (not null)
     if (group == null)
     {
         throw new ArgumentNullException("group is a required property for ClientUiNode and cannot be null");
     }
     this.Group = group;
     // to ensure "messages" is required (not null)
     if (messages == null)
     {
         throw new ArgumentNullException("messages is a required property for ClientUiNode and cannot be null");
     }
     this.Messages = messages;
     // to ensure "meta" is required (not null)
     if (meta == null)
     {
         throw new ArgumentNullException("meta is a required property for ClientUiNode and cannot be null");
     }
     this.Meta = meta;
     // to ensure "type" is required (not null)
     if (type == null)
     {
         throw new ArgumentNullException("type is a required property for ClientUiNode and cannot be null");
     }
     this.Type = type;
     this.AdditionalProperties = new Dictionary <string, object>();
 }
示例#2
0
 /// <summary>
 /// To convert a JSON string into an object
 /// </summary>
 /// <param name="reader">JSON reader</param>
 /// <param name="objectType">Object type</param>
 /// <param name="existingValue">Existing value</param>
 /// <param name="serializer">JSON Serializer</param>
 /// <returns>The object converted from the JSON string</returns>
 public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
 {
     if (reader.TokenType != JsonToken.Null)
     {
         return(ClientUiNodeAttributes.FromJson(JObject.Load(reader).ToString(Formatting.None)));
     }
     return(null);
 }