Ejemplo n.º 1
0
 public StatEvent(StatEventType eventType, XboxLiveUser user, Exception errorInfo, StatEventArgs args)
 {
     EventType = eventType;
     LocalUser = user;
     ErrorInfo = errorInfo;
     EventArgs = args;
 }
Ejemplo n.º 2
0
        public void Increment(StatEventType type)
        {
            var now = DateTime.UtcNow;

            if (!(now.Minute == LastMinuteTime.Minute && now.Hour == LastMinuteTime.Hour && now.Day == LastMinuteTime.Day && now.Month == LastMinuteTime.Month &&
                  now.Year == LastMinuteTime.Year))
            {
                LastMinuteTime = now;
                LastMinute     = new AccountCounters();
            }

            if (!(now.Hour == LastHourTime.Hour && now.Day == LastHourTime.Day && now.Month == LastHourTime.Month &&
                  now.Year == LastHourTime.Year))
            {
                LastHourTime = now;
                LastHour     = new AccountCounters();
            }

            switch (type)
            {
            case StatEventType.Tick:
                Totals.Ticks++;
                LastMinute.Ticks++;
                LastHour.Ticks++;
                break;

            case StatEventType.M1Bar:
                Totals.M1Bars++;
                LastMinute.M1Bars++;
                LastHour.M1Bars++;
                break;

            case StatEventType.H1Bar:
                Totals.H1Bars++;
                LastMinute.H1Bars++;
                LastHour.H1Bars++;
                break;

            case StatEventType.Other:
                Totals.Other++;
                LastMinute.Other++;
                LastHour.Other++;
                break;

            case StatEventType.Unspecified:
            default:
                break;
            }
        }