/// <summary> /// Remove the specified <see cref="EMiscFlag"/> from the device/feature /// </summary> /// <param name="misc">The <see cref="EMiscFlag"/> to remove</param> public void RemoveMiscFlag(EMiscFlag misc) { var currentMisc = _misc; if (Changes.ContainsKey(EProperty.Misc)) { currentMisc = (uint)Changes[EProperty.Misc]; } var tempMisc = currentMisc ^ (uint)misc; if (Changes.ContainsKey(EProperty.Misc)) { Changes[EProperty.Misc] = tempMisc; } else { Changes.Add(EProperty.Misc, tempMisc); } if (_cacheChanges) { return; } _misc = tempMisc; }
/// <summary> /// Determine if the device/feature contains the specified <see cref="EMiscFlag"/> /// </summary> /// <param name="misc">The <see cref="EMiscFlag"/> to look for</param> /// <returns> /// TRUE if the device/feature contains the <see cref="EMiscFlag"/>, /// FALSE if it does not. /// </returns> public bool ContainsMiscFlag(EMiscFlag misc) { var currentMisc = _misc; if (Changes.ContainsKey(EProperty.Misc)) { currentMisc = (uint)Changes[EProperty.Misc]; } return((currentMisc & (uint)misc) != 0); }