//private void OnSelectedSource()
        //{
        //    var facade = new ContainerFacade();
        //    var uiService = facade.Get<IUiService>();

        //    var result = uiService.ShowOpenFileDialog();
        //    if (result != null)
        //    {
        //        Source = result;
        //        RaisePropertyChange("Source");
        //    }
        //}

        private void OnLoadFile()
        {
            var facade    = FacadeFactory.Create();
            var uiService = facade.Get <IUiService>();

            try
            {
                // Load the resutls and refresh the view
                var result = InternalLoadFile(Source);
                resultOverview = facade.Get <ResultOverview>(Bootstrap.Results);
                resultOverview.Reload(result);
                OnRefresh();
            }
            catch (IOServiceException serviceException)
            {
                uiService.ShowDialog(serviceException.Message, "Error");
            }
        }
Пример #2
0
        /// <summary>
        /// Inits the result overview component
        /// </summary>
        /// <param name="overview">the overview instance of the application</param>
        /// <param name="ioService">the I/O service of the application</param>
        public void InitResultOverview(ResultOverview overview, IIOService ioService)
        {
            // If the default source file exists, try to load the content

            var sourceFile = overview.Source;

            if (File.Exists(sourceFile))
            {
                try
                {
                    var results = ioService.LoadResult(sourceFile);
                    overview.Reload(results);
                }
                catch (IOException ioException)
                {
                    //TODO: What to do??
                }
            }
        }