public static bool IsPresetExcludedFromDefaultPresets(Preset preset) { if (preset == null) { throw new ArgumentNullException(nameof(preset)); } return(!preset.GetPresetType().IsValidDefault()); }
public static bool SetAsDefault(Preset preset) { if (preset == null) { throw new ArgumentNullException(nameof(preset)); } return(SetDefaultPresetsForType(preset.GetPresetType(), new[] { new DefaultPreset { m_Filter = string.Empty, m_Preset = preset } })); }
public static void RemoveFromDefault(Preset preset) { var type = preset.GetPresetType(); var list = GetDefaultPresetsForType(type); var newList = list.Where(d => d.m_Preset != preset); if (newList.Count() != list.Length) { SetDefaultPresetsForType(type, newList.ToArray()); } }
public static Preset GetDefaultForPreset(Preset preset) { if (preset == null) { throw new ArgumentNullException(nameof(preset)); } var defaults = GetDefaultPresetsForType(preset.GetPresetType()); foreach (var defaultPreset in defaults) { if (defaultPreset.m_Filter == string.Empty) { return(defaultPreset.m_Preset); } } return(null); }