Beispiel #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = UpdateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ (CurrencyFrom != null ? CurrencyFrom.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CurrencyTo != null ? CurrencyTo.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ New.GetHashCode();
         hashCode = (hashCode * 397) ^ YestdayClose.GetHashCode();
         hashCode = (hashCode * 397) ^ Open.GetHashCode();
         hashCode = (hashCode * 397) ^ High.GetHashCode();
         hashCode = (hashCode * 397) ^ Low.GetHashCode();
         hashCode = (hashCode * 397) ^ (Desc != null ? Desc.GetHashCode() : 0);
         return(hashCode);
     }
 }
        /// <summary>
        /// Serialises all properties. The output will be a dictionary containing the
        /// objects properties in a form that can easily be converted to Json.
        /// </summary>
        ///
        /// <returns>The serialised object in dictionary form.</returns>
        public IDictionary <string, object> Serialise()
        {
            var dictionary = new Dictionary <string, object>();

            // Currency From
            dictionary.Add("CurrencyFrom", CurrencyFrom.Serialise());

            // Amount From
            dictionary.Add("AmountFrom", AmountFrom);

            // Currency To
            dictionary.Add("CurrencyTo", CurrencyTo.Serialise());

            // Amount To
            dictionary.Add("AmountTo", AmountTo);

            return(dictionary);
        }