コード例 #1
0
        /// <summary>
        /// Adds item
        /// </summary>
        /// <param name="address">Address</param>
        /// <param name="item">Item</param>
        public void Add(TAddress address, TItem item)
        {
            var index = IndexOf(address);

            if (index != -1)
            {
                Elements[index] = new ElementsEntry
                {
                    Address = address,
                    Item    = item
                };


                return;
            }


            Elements.Add(new ElementsEntry
            {
                Address = address,
                Item    = item
            });
        }
コード例 #2
0
 /// <summary>
 /// Compares items
 /// </summary>
 /// <param name="lhs">Left-hand value</param>
 /// <param name="rhs">Right-hand value</param>
 /// <returns>Comparison order</returns>
 public static int Compare(ElementsEntry lhs, ElementsEntry rhs)
 {
     return(lhs.Order.CompareTo(rhs.Order));
 }