Пример #1
0
		/// <summary>
		/// Updates item details.
		/// This method is invoked from the item cache thread.
		/// </summary>
		/// <param name="guid">Item guid.</param>
		/// <param name="details">Array of item details.</param>
		internal void UpdateItemDetailsInternal(Guid guid, Utility.Tuple<ColumnType, string, object>[] details)
		{
			ImageListViewItem item = null;
			if (mItems.TryGetValue(guid, out item))
				item.UpdateDetailsInternal(details);
		}
        /// <summary>
        /// Invoked by the worker thread to update item details.
        /// </summary>
        /// <param name="info">Item details.</param>
        internal void UpdateDetailsInternal(Utility.Tuple<ColumnType, string, object>[] info)
        {
            if (!isDirty) return;
            if (info == null) return;

            // File info
            foreach (Utility.Tuple<ColumnType, string, object> item in info)
            {
                switch (item.Item1)
                {
                    case ColumnType.DateAccessed:
                        mDateAccessed = (DateTime)item.Item3;
                        break;
                    case ColumnType.DateCreated:
                        mDateCreated = (DateTime)item.Item3;
                        break;
                    case ColumnType.DateModified:
                        mDateModified = (DateTime)item.Item3;
                        break;
                    case ColumnType.FileSize:
                        mFileSize = (long)item.Item3;
                        break;
                    case ColumnType.FilePath:
                        mFilePath = (string)item.Item3;
                        break;
                    case ColumnType.Dimensions:
                        mDimensions = (Size)item.Item3;
                        break;
                    case ColumnType.Resolution:
                        mResolution = (SizeF)item.Item3;
                        break;
                    case ColumnType.ImageDescription:
                        mImageDescription = (string)item.Item3;
                        break;
                    case ColumnType.EquipmentModel:
                        mEquipmentModel = (string)item.Item3;
                        break;
                    case ColumnType.DateTaken:
                        mDateTaken = (DateTime)item.Item3;
                        break;
                    case ColumnType.Artist:
                        mArtist = (string)item.Item3;
                        break;
                    case ColumnType.Copyright:
                        mCopyright = (string)item.Item3;
                        break;
                    case ColumnType.ExposureTime:
                        mExposureTime = (float)item.Item3;
                        break;
                    case ColumnType.FNumber:
                        mFNumber = (float)item.Item3;
                        break;
                    case ColumnType.ISOSpeed:
                        mISOSpeed = (ushort)item.Item3;
                        break;
                    case ColumnType.UserComment:
                        mUserComment = (string)item.Item3;
                        break;
                    case ColumnType.Rating:
                        mRating = (ushort)item.Item3;
                        break;
                    case ColumnType.Software:
                        mSoftware = (string)item.Item3;
                        break;
                    case ColumnType.FocalLength:
                        mFocalLength = (float)item.Item3;
                        break;
                    case ColumnType.Custom:
                        string label = item.Item2;
                        string value = (string)item.Item3;
                        Guid columnID = Guid.Empty;
                        foreach (ImageListView.ImageListViewColumnHeader column in mImageListView.Columns)
                        {
                            if (label == column.Text)
                                columnID = column.Guid;
                        }
                        if (columnID == Guid.Empty)
                        {
                            ImageListView.ImageListViewColumnHeader column = new ImageListView.ImageListViewColumnHeader(ColumnType.Custom, label);
                            columnID = column.Guid;
                        }
                        if (subItems.ContainsKey(columnID))
                            subItems[columnID] = value;
                        else
                            subItems.Add(columnID, value);
                        break;
                    default:
                        throw new Exception("Unknown column type.");
                }
            }

            UpdateRating();

            isDirty = false;
        }
Пример #3
0
 /// <summary>
 /// Updates item details.
 /// This method is invoked from the item cache thread.
 /// </summary>
 internal void UpdateItemDetailsInternal(ImageListViewItem item, Utility.ShellImageFileInfo info)
 {
     item.UpdateDetailsInternal(info);
 }
Пример #4
0
        /// <summary>
        /// Invoked by the worker thread to update item details.
        /// </summary>
        internal void UpdateDetailsInternal(Utility.ShellImageFileInfo info)
        {
            if (!isDirty) return;

            mDateAccessed = info.LastAccessTime;
            mDateCreated = info.CreationTime;
            mDateModified = info.LastWriteTime;
            mFileSize = info.Size;
            mFileType = info.TypeName;
            mFilePath = info.DirectoryName;
            mDimensions = info.Dimensions;
            mResolution = info.Resolution;
            // Exif tags
            mImageDescription = info.ImageDescription;
            mEquipmentModel = info.EquipmentModel;
            mDateTaken = info.DateTaken;
            mArtist = info.Artist;
            mCopyright = info.Copyright;
            mExposureTime = info.ExposureTime;
            mFNumber = info.FNumber;
            mISOSpeed = info.ISOSpeed;
            mShutterSpeed = info.ShutterSpeed;
            mAperture = info.ApertureValue;
            mUserComment = info.UserComment;

            isDirty = false;
        }