/// <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); } }
public static bool IsSet(this PropertyClassTypes?value, PropertyClassTypes flags) => (value & flags) == flags;
public static PropertyClassTypes?Unset(this PropertyClassTypes?value, PropertyClassTypes flags) { value &= ~flags; return(value == (PropertyClassTypes)0 ? null : value); }
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); }