private void LoadFarmFeatures(LoadFeatureDefinitionQuery message)
        {
            _log.Debug("Entered LoadFarmFeatures");

            if (!TaskCanceled)
            {
                try
                {
                    var farmFeatureDefinitions = dataService.LoadFarmFeatureDefinitions();

                    if (farmFeatureDefinitions == null)
                    {
                        _log.Error("Farm Feature Definitions not found!");
                    }
                    Sender.Tell(new Core.Messages.Completed.FarmFeatureDefinitionsLoaded(
                                    message.TaskId,
                                    farmFeatureDefinitions));

                    //TODO: maybe check, if feature definitions from here have more data, than from activated features ...
                }
                catch (Exception ex)
                {
                    var cancelationMsg = new CancelMessage(
                        message.TaskId,
                        "Error loading feature definitions.",
                        true,
                        ex
                        );

                    Sender.Tell(cancelationMsg);
                }
            }
        }
Esempio n. 2
0
        private void InitiateLoadTask(Location startLocation)
        {
            repository.Clear();

            // initiate read of all feature definitions
            var fdQuery = new LoadFeatureDefinitionQuery(Id);

            featureDefinitionActor.Tell(fdQuery);

            // initiate read of locations
            var loadQuery = new LoadLocationQuery(Id, startLocation);

            LoadTask(loadQuery);
        }
        private void LoadFarmFeatures(LoadFeatureDefinitionQuery message)
        {
            _log.Debug("Entered LoadFarmFeatures");

            var farmFeatureDefinitions = dataService.LoadFarmFeatureDefinitions();

            if (farmFeatureDefinitions == null)
            {
                _log.Error("Farm Feature Definitions not found!");
            }
            Sender.Tell(new Core.Messages.Tasks.FarmFeatureDefinitionsLoaded(
                            message.TaskId,
                            farmFeatureDefinitions));

            //TODO: maybe check, if feature definitions from here have more data, than from activated features ...
        }
Esempio n. 4
0
        private void InitiateLoadTask(Location startLocation)
        {
            // initiate clean all feature definition and location collections
            var clearMessage = new ClearItems(Id);

            eventAggregator.PublishOnUIThread(clearMessage);

            // initiate read of all feature definitions
            var fdQuery = new LoadFeatureDefinitionQuery(Id);

            featureDefinitionActor.Tell(fdQuery);

            // initiate read of locations
            var loadQuery = new LoadLocationQuery(Id, startLocation);

            LoadTask(loadQuery);
        }