public static void RemoveCustomImageSource(CreateCustomImageSourceDelegate creator) { if (_imageSourceFactories.Contains(creator)) { _imageSourceFactories.Remove(creator); } }
public static void RegisterCustomImageSource(CreateCustomImageSourceDelegate creator) { if (!_imageSourceFactories.Contains(creator)) { _imageSourceFactories.Add(creator); } }
/// <summary> /// Tries to replace the <paramref name="oldCreator"/> by the <paramref name="newCreator"/> at the original position in the factory list. /// If the <paramref name="oldCreator"/> doesn't exists, the <paramref name="newCreator"/> will be added to the end of factory list. /// </summary> /// <param name="oldCreator">Old creator</param> /// <param name="newCreator">New creator</param> public static void ReplaceCustomImageSource(CreateCustomImageSourceDelegate oldCreator, CreateCustomImageSourceDelegate newCreator) { int oldIndex = _imageSourceFactories.IndexOf(oldCreator); if (oldIndex >= 0) _imageSourceFactories[oldIndex] = newCreator; else RegisterCustomImageSource(newCreator); }
/// <summary> /// Tries to replace the <paramref name="oldCreator"/> by the <paramref name="newCreator"/> at the original position in the factory list. /// If the <paramref name="oldCreator"/> doesn't exists, the <paramref name="newCreator"/> will be added to the end of factory list. /// </summary> /// <param name="oldCreator">Old creator</param> /// <param name="newCreator">New creator</param> public static void ReplaceCustomImageSource(CreateCustomImageSourceDelegate oldCreator, CreateCustomImageSourceDelegate newCreator) { int oldIndex = _imageSourceFactories.IndexOf(oldCreator); if (oldIndex >= 0) { _imageSourceFactories[oldIndex] = newCreator; } else { RegisterCustomImageSource(newCreator); } }
public static void RemoveCustomImageSource(CreateCustomImageSourceDelegate creator) { if (_imageSourceFactories.Contains(creator)) _imageSourceFactories.Remove(creator); }
public static void RegisterCustomImageSource(CreateCustomImageSourceDelegate creator) { if (!_imageSourceFactories.Contains(creator)) _imageSourceFactories.Add(creator); }