Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="KratosUiNode" /> 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 KratosUiNode(KratosUiNodeAttributes attributes = default(KratosUiNodeAttributes), string group = default(string), List <KratosUiText> messages = default(List <KratosUiText>), KratosUiNodeMeta meta = default(KratosUiNodeMeta), string type = default(string))
 {
     // to ensure "attributes" is required (not null)
     if (attributes == null)
     {
         throw new ArgumentNullException("attributes is a required property for KratosUiNode 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 KratosUiNode 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 KratosUiNode 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 KratosUiNode 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 KratosUiNode and cannot be null");
     }
     this.Type = type;
     this.AdditionalProperties = new Dictionary <string, object>();
 }
Exemplo n.º 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(KratosUiNodeAttributes.FromJson(JObject.Load(reader).ToString(Formatting.None)));
     }
     return(null);
 }