Beispiel #1
0
        public static SsrState Engage(this SsrState ssrState, bool isEngaged)
        {
            var clone = ssrState.Clone();

            clone.IsEngaged = isEngaged;
            clone.Timestamp = DateTime.Now;
            return(clone);
        }
Beispiel #2
0
        public static SsrState Fire(this SsrState ssrState, bool isFiring)
        {
            var clone = ssrState.Clone();

            clone.IsFiring  = isFiring;
            clone.Timestamp = DateTime.Now;
            return(clone);
        }
Beispiel #3
0
        public static SsrState UpdateRequest(this SsrState ssrState, SsrRequestState requestSsrState)
        {
            var clone = ssrState.Clone();

            if (requestSsrState.IsEngaged.HasValue)
            {
                clone.IsEngaged = requestSsrState.IsEngaged.Value;
            }

            if (requestSsrState.Percentage.HasValue)
            {
                clone.Percentage = requestSsrState.Percentage.Value;
            }

            clone.Timestamp = DateTime.Now;

            return(clone);
        }