using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FilteringByCustomTypeSilverlight
{
    public class Message
    {
        public Attachment Attachment { get; set; }
        public string Sender { get; set; }
        public int Size { get; set; }
        public string Subject { get; set; }
    }

    public class Attachment : IEquatable<Attachment>, IComparable<Attachment>
    {
        public string Name { get; set; }

        public override string ToString()
        {
            return string.Format("Name: {0}", this.Name);
        }

        public int CompareTo(Attachment other)
        {
            return this.Name.CompareTo(other.Name);
        }

        public bool Equals(Attachment other)
        {
            return this.Name == other.Name;
        }
    }
}
