Castle.Facilities.WcfIntegration.RoundRobinPolicy.ChooseTarget C# (CSharp) Method

ChooseTarget() protected method

protected ChooseTarget ( ChooseContext choose ) : void
choose ChooseContext
return void
		protected override void ChooseTarget(ChooseContext choose)
		{
			choose.ModifyList(targets =>
			{
				var count = targets.Count;
				for (int index = 0; index < count; ++index)
				{
					var target = targets[index];
					if (choose.Matches(target))
					{
						if (count > 1)
						{
							targets.RemoveAt(index);
							targets.Add(target);
						}
						return target;
					}
				}
				return null;
			});
		}
	}