BO4E/UserPropertiesExtensions.cs
/// <summary>
///     checks if the BusinessObject has a flag set.
/// </summary>
/// <param name="parent">
///     object that implements <see cref="IUserProperties" /> (so either inheriting from
///     <see cref="BO4E.BO.BusinessObject" /> or <see cref="BO4E.COM.COM" />
/// </param>
/// <remarks>
///     "having a flag set" means that the Business Object has a UserProperty entry that has
///     <paramref name="flagKey" /> as key and the value of the user property is true.
/// </remarks>
/// <param name="flagKey"></param>
/// <returns>true iff flag is set and has value true</returns>
checks if the BusinessObject has a flag set.
checks if the BusinessObject has a flag set .
public static bool HasFlagSet<TParent>(this TParent parent, string flagKey)
            where TParent : class, IUserProperties
        {
            if (string.IsNullOrWhiteSpace(flagKey)) throw new ArgumentNullException(nameof(flagKey));
            try
            {
                return parent.UserProperties != null && parent.UserPropertyEquals(flagKey, (bool?)true);
            }
            catch (ArgumentNullException ane) when (ane.ParamName == "value")
            {
                return false;
            }
        }
public static bool HasFlagSet < TParent > ( this TParent parent , string flagKey ) where TParent : class , IUserProperties { if ( string . IsNullOrWhiteSpace ( flagKey ) ) throw new ArgumentNullException ( nameof ( flagKey ) ) ; try { return parent . UserProperties != null && parent . UserPropertyEquals ( flagKey , ( bool ? ) true ) ; } catch ( ArgumentNullException ane ) when ( ane . ParamName == " " ) { return false ; } }
checks if the BusinessObject has a flag set.
checks if the BusinessObject has a flag set .
true iff flag is set and has value true
true iff flag is set and has value true
TParent
this
<not_specific>
flagKey
string
None
parent
<not_specific>
object that implements  (so either inheriting from
or
object that implements ( so either inheriting from or
remarks
"having a flag set" means that the Business Object has a UserProperty entry that has
as key and the value of the user property is true.
" having a flag set " means that the Business Object has a UserProperty entry that has as key and the value of the user property is true .