/// <summary> /// Gets attribute <paramref name="propertyName"/> as string (or returns /// null if does not exists). /// </summary> /// <param name="propertyName">Name of the single property.</param> /// <returns>Property value or null.</returns> public string GetAsStringOrNull(string propertyName) { TikPropertyItem item = GetOrCreateItem(propertyName); if (item.HasValue) { return(item.GetAsString()); } else { return(null); } }
/// <summary> /// Gets attribute <paramref name="propertyName"/> as string (value must be set!). /// </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 string GetAsString(string propertyName) { TikPropertyItem item = GetOrCreateItem(propertyName); return(item.GetAsString()); }