/// <summary>
        /// Initializes a new instance of the <see cref="ModelProperties" /> class.
        /// </summary>
        /// <param name="energy">energy.</param>
        public ModelProperties
        (
            // Required parameters
            ModelEnergyProperties energy = default // Optional parameters
        ) : base()                                 // BaseClass
        {
            this.Energy = energy;

            // Set non-required readonly properties with defaultValue
            this.Type = "ModelProperties";
        }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ModelProperties" /> class.
 /// </summary>
 /// <param name="type">type (default to &quot;ModelProperties&quot;).</param>
 /// <param name="energy">energy.</param>
 public ModelProperties(string type = "ModelProperties", ModelEnergyProperties energy = default)
 {
     // use default value if no "type" provided
     if (type == null)
     {
         this.Type = "ModelProperties";
     }
     else
     {
         this.Type = type;
     }
     this.Energy = energy;
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ModelProperties" /> class.
        /// </summary>
        /// <param name="energy">energy.</param>
        public ModelProperties
        (
            // Required parameters
            ModelEnergyProperties energy = default // Optional parameters
        ) : base()                                 // BaseClass
        {
            this.Energy = energy;

            // Set non-required readonly properties with defaultValue
            this.Type = "ModelProperties";

            // check if object is valid
            if (this.GetType() == typeof(ModelProperties))
            {
                this.IsValid(throwException: true);
            }
        }