/// <summary>
        /// Initializes a new instance of the <see cref="ContextShade" /> class.
        /// </summary>
        /// <param name="geometry">An array of planar Face3Ds that together represent the context shade. (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="identifier">Text string for a unique object ID. This identifier remains constant as the object is mutated, copied, and serialized to different formats (eg. dict, idf, rad). This identifier is also used to reference the object across a Model. It must be &lt; 100 characters and not contain any spaces or special characters. (required).</param>
        /// <param name="displayName">Display name of the object with no character restrictions..</param>
        /// <param name="userData">Optional dictionary of user data associated with the object.All keys and values of this dictionary should be of a standard data type to ensure correct serialization of the object (eg. str, float, int, list)..</param>
        public ContextShade
        (
            string identifier, List <Face3D> geometry, ContextShadePropertiesAbridged properties, // Required parameters
            string displayName = default, Object userData = default                               // Optional parameters
        ) : base(identifier: identifier, displayName: displayName, userData: userData)            // BaseClass
        {
            // to ensure "geometry" is required (not null)
            this.Geometry = geometry ?? throw new ArgumentNullException("geometry is a required property for ContextShade and cannot be null");
            // to ensure "properties" is required (not null)
            this.Properties = properties ?? throw new ArgumentNullException("properties is a required property for ContextShade and cannot be null");

            // Set non-required readonly properties with defaultValue
            this.Type = "ContextShade";
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ContextShade" /> class.
        /// </summary>
        /// <param name="name">Name of the object used in all simulation engines. Must not contain spaces and use only letters, digits and underscores/dashes. It cannot be longer than 100 characters. (required).</param>
        /// <param name="geometry">An array of planar Face3Ds that together represent the context shade. (required).</param>
        /// <param name="properties">Extension properties for particular simulation engines (Radiance, EnergyPlus). (required).</param>
        /// <param name="displayName">Display name of the object with no restrictions..</param>
        /// <param name="type">type (default to &quot;ContextShade&quot;).</param>
        public ContextShade(string name, List <Face3D> geometry, ContextShadePropertiesAbridged properties, string displayName = default, string type = "ContextShade")
        {
            // to ensure "name" is required (not null)
            if (name == null)
            {
                throw new InvalidDataException("name is a required property for ContextShade and cannot be null");
            }
            else
            {
                this.Name = name;
            }

            // to ensure "geometry" is required (not null)
            if (geometry == null)
            {
                throw new InvalidDataException("geometry is a required property for ContextShade and cannot be null");
            }
            else
            {
                this.Geometry = geometry;
            }

            // to ensure "properties" is required (not null)
            if (properties == null)
            {
                throw new InvalidDataException("properties is a required property for ContextShade and cannot be null");
            }
            else
            {
                this.Properties = properties;
            }

            this.DisplayName = displayName;
            // use default value if no "type" provided
            if (type == null)
            {
                this.Type = "ContextShade";
            }
            else
            {
                this.Type = type;
            }
        }