Beispiel #1
0
        /// <summary>
        /// Sets enumeration attribute for the handle.
        /// </summary>
        /// <remarks>
        /// If value is null or empty, the attribute will be unset.
        /// </remarks>
        /// <param name="handle">The handle.</param>
        /// <param name="name">The attribute name.</param>
        /// <param name="value">The enumeration value.</param>
        /// <exception cref="ArgumentException">If the name is null or empty.</exception>
        public static void SetAttribute(IFCAnyHandle handle, string name, Enum value)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentException("The name is empty.", "name");
            }

            if (value != null)
            {
                handle.SetAttribute(name, IFCData.CreateEnumeration(value.ToString()));
            }
        }