/// <summary> /// Gets attribute <paramref name="propertyName"/> as bool (or returns /// null if does not exists). /// </summary> /// <param name="propertyName">Name of the single property.</param> /// <returns>Property value or null.</returns> public bool?GetAsBooleanOrNull(string propertyName) { TikPropertyItem item = GetOrCreateItem(propertyName); if (item.HasValue) { return(item.GetAsBool()); } else { return(null); } }
/// <summary> /// Gets attribute <paramref name="propertyName"/> as bool (or returns /// default value if does not exists). /// </summary> /// <param name="propertyName">Name of the single property.</param> /// <returns>Property value or exception.</returns> /// <exception cref="InvalidOperationException">If property is not defined.</exception> public bool GetAsBoolean(string propertyName) { TikPropertyItem item = GetOrCreateItem(propertyName); return(item.GetAsBool()); }