/// <summary> /// Unsets a drop description flag. /// </summary> /// <param name="dataObject">The associated DataObject.</param> /// <param name="flag">The drop description flag to unset.</param> private static void UnsetDropDescriptionFlag(IDataObject dataObject, DropDescriptionFlags flag) { if (s_dropDescriptions.ContainsKey(dataObject)) { DropDescriptionFlags current = s_dropDescriptions[dataObject]; s_dropDescriptions[dataObject] = (current | flag) ^ flag; } }
/// <summary> /// Sets a drop description flag. /// </summary> /// <param name="dataObject">The associated DataObject.</param> /// <param name="flag">The drop description flag to set.</param> /// <param name="enabled">True to set the flag, False to unset it.</param> private static void SetDropDescriptionFlag(IComDataObject dataObject, DropDescriptionFlags flag, bool enabled) { var current = GetDropDescriptionFlag(dataObject); var next = enabled ? (current | flag) : (current | flag) ^ flag; if (current != next) { dataObject.SetData("DropDescriptionFlags", (int)next); } }
/// <summary> /// Sets a drop description flag. /// </summary> /// <param name="dataObject">The associated DataObject.</param> /// <param name="flag">The drop description flag to set.</param> private static void SetDropDescriptionFlag(IDataObject dataObject, DropDescriptionFlags flag) { if (s_dropDescriptions.ContainsKey(dataObject)) { s_dropDescriptions[dataObject] |= flag; } else { s_dropDescriptions.Add(dataObject, flag); } }
/// <summary> /// Sets a drop description flag. /// </summary> /// <param name="dataObject">The associated DataObject.</param> /// <param name="flag">The drop description flag to set.</param> private static void SetDropDescriptionFlag(IDataObject dataObject, DropDescriptionFlags flag) { if (s_dropDescriptions.ContainsKey(dataObject)) s_dropDescriptions[dataObject] |= flag; else s_dropDescriptions.Add(dataObject, flag); }