internal static void VerifyErrorPropertyNotFound(ref ErrorPropertyBitMask propertiesFoundBitField, ErrorPropertyBitMask propertyFoundBitMask, string propertyName) { if (!ErrorPropertyNotFound(ref propertiesFoundBitField, propertyFoundBitMask)) { throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName(propertyName)); } }
internal static bool ErrorPropertyNotFound(ref ErrorPropertyBitMask propertiesFoundBitField, ErrorPropertyBitMask propertyFoundBitMask) { if ((propertiesFoundBitField & propertyFoundBitMask) == propertyFoundBitMask) { return(false); } propertiesFoundBitField |= propertyFoundBitMask; return(true); }
/// <summary> /// Verifies that the specified property was not yet found. /// </summary> /// <param name="propertiesFoundBitField"> /// The bit field which stores which properties of an error or inner error were found so far. /// </param> /// <param name="propertyFoundBitMask">The bit mask for the property to check.</param> /// <param name="propertyName">The name of the property to check (used for error reporting).</param> internal static void VerifyErrorPropertyNotFound( ref ErrorPropertyBitMask propertiesFoundBitField, ErrorPropertyBitMask propertyFoundBitMask, string propertyName) { DebugUtils.CheckNoExternalCallers(); Debug.Assert(((int)propertyFoundBitMask & (((int)propertyFoundBitMask) - 1)) == 0, "propertyFoundBitMask is not a power of 2."); Debug.Assert(!string.IsNullOrEmpty(propertyName), "!string.IsNullOrEmpty(propertyName)"); if (!ErrorPropertyNotFound(ref propertiesFoundBitField, propertyFoundBitMask)) { throw new ODataException(o.Strings.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName(propertyName)); } }