Пример #1
0
 public int GetHashCode(CalendarItemState obj)
 {
     if (obj == null || !obj.ContainsKey(this.stateKey))
     {
         return(0);
     }
     return(obj[this.stateKey].GetHashCode());
 }
Пример #2
0
        public bool Evaluate(CalendarItemState state, PropertyBag propertyBag, MailboxSession session)
        {
            Util.ThrowOnNullArgument(state, "state");
            Util.ThrowOnNullArgument(propertyBag, "propertyBag");
            Util.ThrowOnNullArgument(session, "session");
            TValue tvalue;

            if (state.ContainsKey(this.stateKey))
            {
                tvalue = (TValue)((object)state[this.stateKey]);
            }
            else
            {
                tvalue = this.GetValueFromPropertyBag(propertyBag, session);
                state[this.stateKey] = tvalue;
            }
            return(this.Evaluate(tvalue));
        }
Пример #3
0
        public bool Equals(CalendarItemState x, CalendarItemState y)
        {
            if (x == y)
            {
                return(true);
            }
            if (x == null || y == null)
            {
                return(false);
            }
            if (!x.ContainsKey(this.stateKey) || !y.ContainsKey(this.stateKey))
            {
                throw new ArgumentException("The states don't have the required data.");
            }
            object obj  = x[this.stateKey];
            object obj2 = y[this.stateKey];

            if (obj == null)
            {
                return(obj2 == null);
            }
            return(obj.Equals(obj2));
        }