using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace FilteringByCustomTypeSilverlight
{
    public class OlapValue : IComparable<OlapValue>, IEquatable<OlapValue>
    {
        public string ConverterParameter { get; set; }
        public object Value { get; set; }
        public double ValueAsDouble
        {
            get
            {
                return (double)Value;
            }
        }

        public override string ToString()
        {
            return Value.ToString();
        }

        #region IComparable<OlapValue> Members

        public int CompareTo(OlapValue other)
        {
            return this.ValueAsDouble.CompareTo(other.ValueAsDouble);
        }

        #endregion

        #region IEquatable<OlapValue> Members

        public bool Equals(OlapValue other)
        {
            return this.ValueAsDouble == other.ValueAsDouble;
        }

        #endregion

    }
}
