Statistics
| Branch: | Revision:

root / trunk / Pithos.Core / Agents / ObjectInfoComparer.cs @ 039d89ea

History | View | Annotate | Download (994 Bytes)

1
// -----------------------------------------------------------------------
2
// <copyright file="ObjectInfoComparer.cs" company="Microsoft">
3
// TODO: Update copyright text.
4
// </copyright>
5
// -----------------------------------------------------------------------
6

    
7
using Pithos.Interfaces;
8

    
9
namespace Pithos.Core.Agents
10
{
11
    using System;
12
    using System.Collections.Generic;
13
    using System.Linq;
14
    using System.Text;
15

    
16
    /// <summary>
17
    /// TODO: Update summary.
18
    /// </summary>
19
    public class ObjectInfoComparer : EqualityComparer<ObjectInfo>
20
    {
21
        public override bool Equals(ObjectInfo x, ObjectInfo y)
22
        {
23
            return (x.Account == y.Account &&
24
                    x.Container == y.Container &&
25
                    x.Name == y.Name);
26
        }
27

    
28
        public override int GetHashCode(ObjectInfo obj)
29
        {
30
            return String.Join("/", obj.Account, obj.Container, obj.Name).GetHashCode();
31
        }
32
    }
33

    
34
}