Beispiel #1
0
        public override string this[int index]
        {
            get
            {
                switch (index)
                {
                case 0:
                    return(ID);

                case 1:
                    return(Path);

                case 2:
                    return(FileName);

                case 3:
                    return(FileType.ToString());

                case 4:
                    return((Tags == null) ? "" : String.Join(",", Tags));

                case 5:
                    return(AccessCount.ToString());

                case 6:
                    return(IsFavorite ? "1" : "0");

                case 7:
                    return(IsHidden ? "1" : "0");

                default: throw new ArgumentOutOfRangeException($"RawFileData does not contain a property at index {index}");
                }
            }
        }
        /// <summary>
        /// Compares this AmbientBottleneckAccessRecord to another one to see which one has used more towards any set limit.
        /// </summary>
        /// <param name="other">The other AmbientBottleneckAccessRecord.</param>
        /// <returns>&gt;0 if this one has used more than <paramref name="other"/>, &lt;0 if this one has used less than <paramref name="other"/>, or 0 if they have used the same amount.</returns>
        public int CompareTo(AmbientBottleneckAccessor?other)
        {
            if (ReferenceEquals(other, null))
            {
                return(1);
            }
            int diff = this._utilization.CompareTo(other._utilization);

            if (diff != 0)
            {
                return(diff);
            }
            diff = this._limitUsed.CompareTo(other._limitUsed);
            if (diff != 0)
            {
                return(diff);
            }
            return(AccessCount.CompareTo(other.AccessCount));
        }
 public static ObjectAssertions HaveAccessCount(this ObjectAssertions objectAssertions, int count)
 {
     (objectAssertions.Subject as CacheStatistics) !.AccessCount.Should().Be(count);
     return(objectAssertions);
 }