public async void Export()
 {
     await SafeExecute(async() =>
     {
         string exportedTree   = await _informationProvider.Export(_moduleName);
         bool result           = await _saver.SaveStringToFile(exportedTree, _moduleName, ".xml");
         ExportResultViewModel = new ImportExportResultViewModel {
             HasFailed = !result
         };
         _states.ChangeToContentState();
     });
 }
        private async void PollSelectedController()
        {
            _detailStates.ChangeToLoadingState();
            try
            {
                Controller controller = await _informationProvider.ImportController(_moduleName, SelectedItem.Id);

                HandleControllerUpdate(controller);
                _detailStates.ChangeToContentState();
            }
            catch (Exception exception)
            {
                _detailStates.ChangeToErrorState(exception.ToString());
            }
        }
示例#3
0
 public virtual void TryInitializeModules()
 {
     _logger.Debug(string.Format("{0} tries to initialize the view models", this));
     _states.ChangeToLoadingState();
     try
     {
         Action <string> updateInitializationMessage = m => ModuleInInitialization = m;
         InitializeScreens();
         HeadBarViewModel.BreadcrumbBarViewModel = new BreadcrumbBarViewModel(_homeScreen);
         NavigateToHome();
         _states.ChangeToContentState();
         LoginCommand.CanExecute(null);
         _logger.Debug(string.Format("{0} successfully initialized the modules.", this));
     }
     catch (Exception exception)
     {
         string errorMessage = new StringBuilder()
                               .AppendLine("An error occured while intializing the Remote UI:")
                               .Append(exception).ToString();
         _logger.ErrorFormat("{0} failed to initalize the modules: '{1}'", this, errorMessage);
         _states.ChangeToErrorState(errorMessage);
     }
 }