private void FarmFeatureDefinitionsLoaded(FarmFeatureDefinitionsLoaded message) { FarmFeatureDefinitions.Processed = message.FarmFeatureDefinitions.Count(); if (FarmFeatureDefinitions.Completed) { SendProgress(); if (Preparations.Completed) { eventAggregator.PublishOnUIThread(message); // locations already loaded? if (tempLocationStore.Count() > 0) { foreach (LocationsLoaded loadedMsg in tempLocationStore) { eventAggregator.BeginPublishOnUIThread(loadedMsg); } tempLocationStore.Clear(); } } else { tempFeatureDefinitionStore = message; } } }
public void HandleClearItemsReady(ClearItemsReady message) { // how many steps are expected is decided in Common.Constants.Tasks.PreparationStepsForLoad Preparations.Processed++; if (Preparations.Completed) { SendProgress(); // feature definitions already loaded? if (tempFeatureDefinitionStore != null) { eventAggregator.BeginPublishOnUIThread(tempFeatureDefinitionStore); tempFeatureDefinitionStore = null; } // locations already loaded? if (FarmFeatureDefinitions.Completed && tempLocationStore.Count() > 0) { foreach (LocationsLoaded loadedMsg in tempLocationStore) { eventAggregator.BeginPublishOnUIThread(loadedMsg); } tempLocationStore.Clear(); } } }
private void FarmFeatureDefinitionsLoaded(FarmFeatureDefinitionsLoaded message) { var definitions = message.FarmFeatureDefinitions; FarmFeatureDefinitions.Processed = definitions.Count(); //TODO: check if this can go away, why should it not be completed here? if (FarmFeatureDefinitions.Completed) { repository.AddFeatureDefinitions(definitions); SendProgress(); if (definitions.Any(fd => fd.Scope == Enums.Scope.ScopeInvalid)) { foreach (var fd in definitions.Where(fd => fd.Scope == Enums.Scope.ScopeInvalid)) { LogToUi( Enums.LogLevel.Warning, string.Format( "Invalid feature definition found: {0}", fd.ToString() ) ); } } } }
public void Handle([NotNull] FarmFeatureDefinitionsLoaded message) { foreach (FeatureDefinition fd in message.FarmFeatureDefinitions) { allItems.Add(fd); } }
private void FarmFeatureDefinitionsLoaded(FarmFeatureDefinitionsLoaded message) { FarmFeatureDefinitions.Processed = message.FarmFeatureDefinitions.Count(); if (FarmFeatureDefinitions.Completed) { repository.AddFeatureDefinitions(message.FarmFeatureDefinitions); SendProgress(); } }