コード例 #1
0
		public int Evaluate(EvaluationContext context)
		{
			return _opinions
				.Select(x => x.GetPosition(context))
				.Where(x => x >= 0)
				.Last();
		}
コード例 #2
0
		public int GetPosition(EvaluationContext context)
		{
			if (context.NumberOfAttendees >= context.Configuration.HardLimit)
			{
				context.Logger.Info(String.Format("User entry for '{0}' is on the waiting list, hard limit of {1} reached with {2} entries",
										   context.User.UserName,
										   context.Configuration.HardLimit,
										   context.NumberOfAttendees),
							 "SYSTEM");

				return context.WaitingListEnd;
			}

			return int.MinValue;
		}
コード例 #3
0
		public int GetPosition(EvaluationContext context)
		{
			if (context.NumberOfAttendees >= context.Configuration.MaximumAttendees && context.User.Data.Sponsoring <= decimal.Zero)
			{
				context.Logger.Info(String.Format("User entry for '{0}' is on the waiting list, maximum attendee count of {1} is reached with {2} entries",
										   context.User.UserName,
										   context.Configuration.MaximumAttendees,
										   context.NumberOfAttendees),
				             "SYSTEM");

				return context.WaitingListEnd;
			}

			return int.MinValue;
		}