async Task ISetupRequired.SetupAsync() { using (new DeferUpdate(this)) { var options = await provider.GetOptionsAsync(TimeSpan.Zero, cts.Token); } }
async Task ISetupRequired.SetupAsync() { using (subscription.DisableTracking(true)) { // var enumType = typeof(ShowWelcomeDialog); var options = await provider.GetOptionsAsync(CancellationToken.None); /*foreach (ShowWelcomeDialog value in Enum.GetValues(enumType)) * { * dialogModes.Add(new ShowDialogActionItem(value, localizer.GetStringForShowDialogAction(Enum.GetName(enumType, value)))); * } * * CurrentDialogMode = options.WelcomeDialogAction;*/ } }
/// <summary> /// /// </summary> /// <returns></returns> public async Task <ISimulationSession> RunAsync() { var random = new Random(); var options = await optionsProvider.GetOptionsAsync(CancellationToken.None); var beehives = new Collection <IBeehive>(); foreach (var index in Enumerable.Range(1, options.NumberOfBeehives + 1)) { var maximumNumberOfBees = random.Next(options.MinimumNumberOfBees, options.MaximumNumberOfBees); var beehive = new Beehive(index, maximumNumberOfBees); var hasQueen = false; beehives.Add(beehive); foreach (var num in Enumerable.Range(0, beehive.MaximumNumberOfBees)) { IBeeBehaviour behaviour; if (hasQueen) { var lifetime = random.Next(100, 500); behaviour = new WorkingBeeBehaviour(lifetime); } else { behaviour = new QueenBeeBehaviour(); hasQueen = true; } var bee = new Bee(beehive, num, behaviour); beehive.AddBee(bee); } } return(new SimulationSession(beehives, options.Interval, Cleanup)); }
async Task ISetupRequired.SetupAsync() { var options = await optionsProvider.GetOptionsAsync(CancellationToken.None); }