コード例 #1
0
    /// <summary>
    /// Sammelt die Namen der in <paramref name="propertyClassType"/> gesetzten Flags in
    /// <paramref name="list"/>. <paramref name="list"/> wird von der Methode nicht
    /// geleert.
    /// </summary>
    /// <param name="propertyClassType"><see cref="PropertyClassTypes"/>-Objekt oder <c>null</c>.</param>
    /// <param name="list">Eine Liste zum sammeln.</param>
    internal static void CollectValueStrings(PropertyClassTypes?propertyClassType, List <string> list)
    {
        Debug.Assert(list != null);

        if (!propertyClassType.HasValue)
        {
            return;
        }

        PropertyClassTypes value = propertyClassType.Value;

        if (value.HasFlag(PropertyClassTypes.Home))
        {
            list.Add(ParameterSection.TypeValue.HOME);
        }

        if (value.HasFlag(PropertyClassTypes.Work))
        {
            list.Add(ParameterSection.TypeValue.WORK);
        }
    }
コード例 #2
0
 public static bool IsSet(this PropertyClassTypes?value, PropertyClassTypes flags) => (value & flags) == flags;
コード例 #3
0
 public static PropertyClassTypes?Unset(this PropertyClassTypes?value, PropertyClassTypes flags)
 {
     value &= ~flags;
     return(value == (PropertyClassTypes)0 ? null : value);
 }
コード例 #4
0
 public static PropertyClassTypes?Set(this PropertyClassTypes?value, PropertyClassTypes flags)
 {
     // Check inlining:
     // Trace.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
     return(value.HasValue ? (value.Value | flags) : flags);
 }