using System; using System.Collections.Generic; using System.Linq; namespace Emby.Naming.Video { /// /// Object holding list of files paths with additional information. /// public class FileStack { /// /// Initializes a new instance of the class. /// public FileStack() { Files = new List(); } /// /// Gets or sets name of file stack. /// public string Name { get; set; } = string.Empty; /// /// Gets or sets list of paths in stack. /// public List Files { get; set; } /// /// Gets or sets a value indicating whether stack is directory stack. /// public bool IsDirectoryStack { get; set; } /// /// Helper function to determine if path is in the stack. /// /// Path of desired file. /// Requested type of stack. /// True if file is in the stack. public bool ContainsFile(string file, bool isDirectory) { if (IsDirectoryStack == isDirectory) { return Files.Contains(file, StringComparer.OrdinalIgnoreCase); } return false; } } }