Exemplo n.º 1
0
        /// <summary>
        /// Reads the image resources.
        /// </summary>
        /// <param name="folder">The folder.</param>
        private DocumentPictureCollection ReadImageResources(string folder)
        {
            DocumentPictureCollection dpc = new DocumentPictureCollection();

            try
            {
                //If folder not exists, return (folder will only unpacked if not empty)
                if (!Directory.Exists(folder))
                {
                    return(dpc);
                }
                //Only image files should be in this folder, if not -> Exception
                DirectoryInfo di = new DirectoryInfo(folder);
                foreach (FileInfo fi in di.GetFiles())
                {
                    DocumentPicture dp = new DocumentPicture(fi.FullName);
                    dpc.Add(dp);
                }
            }
            catch (Exception ex)
            {
                throw;
            }

            return(dpc);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the image resources.
        /// </summary>
        /// <param name="folder">The folder.</param>
        private DocumentPictureCollection ReadImageResources(string folder)
        {
            DocumentPictureCollection dpc = new DocumentPictureCollection();

            //If folder not exists, return (folder will only unpacked if not empty)
            if (!_packageReader.DirectoryExists(folder))
            {
                return(dpc);
            }
            //Only image files should be in this folder, if not -> Exception
            foreach (IFile file in _packageReader.GetFiles(folder))
            {
                DocumentPicture dp = new DocumentPicture(file);
                dpc.Add(dp);
            }

            return(dpc);
        }