Example #1
0
        /// <summary>
        /// Get the files from the selected directory that match the filter
        /// </summary>
        /// <param name="FolderPath"></param>
        /// <param name="Format"></param>
        /// <param name="Tags"></param>
        /// <returns></returns>

        public static string[] getFiles(string FolderPath, string[] Format, string[] Tags)
        {
            string[]      filesToSearch = getFiles(FolderPath, Format);
            List <string> newListFiles  = new List <string>();

            foreach (string file in filesToSearch)
            {
                Fonctions.MetaData_ReadWrite metadata = new MetaData_ReadWrite(file);

                if (metadata.Tags != null) // no tags available (not jpeg)
                {
                    foreach (string tag in metadata.Tags)
                    {
                        if (Array.Exists(Tags, element => element == tag))
                        {
                            if (!newListFiles.Contains(file))
                            {
                                newListFiles.Add(file);
                            }
                        }
                    }
                }
                else
                {
                    newListFiles.Add(file);
                }
            }

            return(newListFiles.ToArray());
        }
Example #2
0
        /// <summary>
        /// Get the files from the selected directory that match the filter
        /// </summary>
        /// <param name="FolderPath"></param>
        /// <param name="Format"></param>
        /// <param name="Favorite"></param>
        /// <param name="DateStart"></param>
        /// <param name="DateEnd"></param>
        /// <returns></returns>

        public static string[] getFiles(string FolderPath, string[] Format, Boolean Favorite, DateTime DateStart, DateTime DateEnd)
        {
            string[]      filesToSearch = getFiles(FolderPath, Format);
            List <string> newListFiles  = new List <string>();

            foreach (string file in filesToSearch)
            {
                Fonctions.MetaData_ReadWrite metadata = new MetaData_ReadWrite(file);

                if (metadata.Date != "") // no date available
                {
                    if ((DateCompare(Convert.ToDateTime(metadata.Date), DateStart)) && (!DateCompare(Convert.ToDateTime(metadata.Date), DateEnd)) && (metadata.Favorite))
                    {
                        newListFiles.Add(file);
                    }
                }
                else
                {
                    if (metadata.Favorite)
                    {
                        newListFiles.Add(file);
                    }
                }
            }

            return(newListFiles.ToArray());
        }
Example #3
0
        /// <summary>
        /// Get the files from the selected directory that match the filter
        /// </summary>
        /// <param name="FolderPath"></param>
        /// <param name="Format"></param>
        /// <param name="Favorite"></param>
        /// <returns></returns>


        public static string[] getFiles(string FolderPath, string[] Format, Boolean Favorite)
        {
            string[]      filesToSearch = getFiles(FolderPath, Format);
            List <string> newListFiles  = new List <string>();

            foreach (string file in filesToSearch)
            {
                Fonctions.MetaData_ReadWrite metadata = new MetaData_ReadWrite(file);
                if (metadata.Favorite)
                {
                    newListFiles.Add(file);
                }
            }

            return(newListFiles.ToArray());
        }
Example #4
0
        /// <summary>
        /// Get the files from the selected directory that match the filter
        /// </summary>
        /// <param name="FolderPath"></param>
        /// <param name="Format"></param>
        /// <param name="Favorite"></param>
        /// <param name="Date"></param>
        /// <returns></returns>

        public static string[] getFiles(string FolderPath, string[] Format, Boolean Favorite, DateTime Date, string[] Tags)
        {
            string[]      filesToSearch = getFiles(FolderPath, Format);
            List <string> newListFiles  = new List <string>();

            foreach (string file in filesToSearch)
            {
                Fonctions.MetaData_ReadWrite metadata = new MetaData_ReadWrite(file);

                if (metadata.Tags != null) // no tags available (not jpeg)
                {
                    foreach (string tag in metadata.Tags)
                    {
                        if (Array.Exists(Tags, element => element == tag))
                        {
                            if (metadata.Date != "") // no date available
                            {
                                if ((DateCompare(Convert.ToDateTime(metadata.Date), Date)) && (metadata.Favorite))
                                {
                                    if (!newListFiles.Contains(file))
                                    {
                                        newListFiles.Add(file);
                                    }
                                }
                            }
                            else
                            {
                                if (metadata.Favorite)
                                {
                                    if (!newListFiles.Contains(file))
                                    {
                                        newListFiles.Add(file);
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    newListFiles.Add(file);
                }
            }


            return(newListFiles.ToArray());
        }