Пример #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="path">Path where the pictures are</param>
        public PictureList(string path)
        {
            _Path = path;

            _ExifPictures       = new PictureInfoList(path);
            _ConsolidatedList   = new Dictionary <string, PictureComparer>();
            _ChangesPendingList = new Dictionary <string, PictureComparer>();

            // now add all pictures having exiftool information
            foreach (KeyValuePair <string, PictureInfo> entry in _ExifPictures)
            {
                if (_ConsolidatedList.ContainsKey(entry.Key))
                {
                    _ConsolidatedList[entry.Key].ExifInfo = entry.Value as ExifPictureInfo;
                    _ConsolidatedList[entry.Key].CheckPics();
                }
                else
                {
                    PictureComparer pc = new PictureComparer();
                    pc.ExifInfo = entry.Value as ExifPictureInfo;
                    pc.CheckPics();
                    _ConsolidatedList.Add(entry.Key, pc);
                }
            }
            // setup the changes pending list
            foreach (KeyValuePair <string, PictureComparer> kvp in _ConsolidatedList)
            {
                if (kvp.Value.ExifUpdateNeeded)
                {
                    _ChangesPendingList.Add(kvp.Key, kvp.Value);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="path">Path where the pictures are</param>
        public PictureList(string path)
        {
            _Path = path;

             _ExifPictures = new PictureInfoList(path);
             _ConsolidatedList = new Dictionary<string, PictureComparer>();
             _ChangesPendingList = new Dictionary<string, PictureComparer>();

             // now add all pictures having exiftool information
             foreach (KeyValuePair<string, PictureInfo> entry in _ExifPictures)
             {
            if (_ConsolidatedList.ContainsKey(entry.Key))
            {
               _ConsolidatedList[entry.Key].ExifInfo = entry.Value as ExifPictureInfo;
               _ConsolidatedList[entry.Key].CheckPics();
            }
            else
            {
               PictureComparer pc = new PictureComparer();
               pc.ExifInfo = entry.Value as ExifPictureInfo;
               pc.CheckPics();
               _ConsolidatedList.Add(entry.Key, pc);
            }
             }
             // setup the changes pending list
             foreach (KeyValuePair<string, PictureComparer> kvp in _ConsolidatedList)
             {
            if (kvp.Value.ExifUpdateNeeded)
            {
               _ChangesPendingList.Add(kvp.Key, kvp.Value);
            }
             }
        }