/// <summary> /// Moves the Specified Plugin to the bottom /// </summary> /// <param name="queue">The Queue</param> /// <param name="pluginName">The Plugin to be moved.</param> /// <param name="addIfNotFound">When not found add the plugin to the Load Order List</param> public static void MoveToBottom(LoadOrderQueue queue, string pluginName, bool addIfNotFound = false) { List <string> lst = GetLoadOrderList(queue); bool contains = lst.Contains(pluginName); if (!addIfNotFound && !contains) { return; } if (contains) { lst.Remove(pluginName); } lst.Add(pluginName); SetLoadOrderList(queue, lst); }
/// <summary> /// Moves the Specified Plugin down one Entry /// </summary> /// <param name="queue">The Queue</param> /// <param name="pluginName">The Plugin to be moved.</param> public static void MoveDown(LoadOrderQueue queue, string pluginName) { List <string> lst = GetLoadOrderList(queue); bool contains = lst.Contains(pluginName); if (!contains) { return; } int idx = lst.IndexOf(pluginName); if (idx == lst.Count - 1) { return; } int newIdx = idx + 1; lst.RemoveAt(idx); lst.Insert(newIdx, pluginName); SetLoadOrderList(queue, lst); }
/// <summary> /// Saves the Load Order List of the Specified Queue /// </summary> /// <param name="queue">The Queue Specified</param> /// <param name="value">The new Load Order List</param> public static void SetLoadOrderList(LoadOrderQueue queue, List <string> value) { ListHelper.SaveList(Queues[(int)queue], value.ToArray()); }
/// <summary> /// Returns the Load Order List of the Specified Queue /// </summary> /// <param name="queue">The Queue Specified</param> /// <returns>Load Order List</returns> public static List <string> GetLoadOrderList(LoadOrderQueue queue) { return(ListHelper.LoadList(Queues[(int)queue]).ToList()); }
/// <summary> /// Checks if the Plugin is set in the specified queue. /// </summary> /// <param name="queue">The Queue</param> /// <param name="pluginName">The Plugin to be checked</param> /// <returns>True of the Plugin is Contained in the Queue</returns> public static bool Contains(LoadOrderQueue queue, string pluginName) { return(GetLoadOrderList(queue).Contains(pluginName)); }