Example #1
0
        public void AddProperties(Dictionary <string, string> properties)
        {
            var newState = new FlatOfferState {
                Created    = State.Created,
                Properties = properties
            };

            AddState(newState);
        }
Example #2
0
        public FlatOfferState DeepCopy()
        {
            FlatOfferState deepCopy = new FlatOfferState {
                LastChecked = this.LastChecked,
                Created     = this.Created,
                Delisted    = this.Delisted,
                Properties  = this.Properties,
            };

            return(deepCopy);
        }
Example #3
0
        public override bool Equals(Object obj)
        {
            bool           isEqual      = obj is FlatOfferState;
            FlatOfferState objConverted = (FlatOfferState)obj;

            // isEqual = isEqual && objConverted.Created == Created;
            isEqual = isEqual && Properties.Keys.Count == objConverted.Properties.Keys.Count &&
                      Properties.Keys.All(k => objConverted.Properties.ContainsKey(k) && object.Equals(objConverted.Properties[k], Properties[k]));

            return(isEqual);
        }
Example #4
0
        public void AddState(FlatOfferState newState)
        {
            var timeStamp = DateTime.UtcNow;

            State.LastChecked    = newState.Created;
            newState.LastChecked = timeStamp;
            if (StateHistory == null)
            {
                StateHistory = new List <FlatOfferState>();
            }
            StateHistory.Add(State);
            State = newState;
        }