public MainWindowViewModel(Action <List <CheckResult> > showResult, Action <string> showMessage)
        {
            try
            {
                var repo            = new SpecDocMetaInfoRepository();
                var rcReaderFactory = new ResourceFileReaderFactory();
                var checker         = new ResourceChecker(rcReaderFactory, repo);
                SpecDocments = repo.GetSpecList();
                CheckTargets = new ObservableCollection <CheckTargetViewModel>();
                CheckTargets.Add(new CheckTargetViewModel());

                Check = new DelegateCommand(
                    () =>
                {
                    try
                    {
                        var targets = CheckTargets.Select(
                            x => new CheckTarget()
                        {
                            SpecName  = x.SpecName,
                            SheetName = x.SheetName,
                            CheckRows = x.CheckRows.Split(new char[] { ',' }).Select(n => int.Parse(n.Trim())).ToList(),
                        }
                            ).ToList();
                        var result = checker.Check(targets);
                        showResult(result);
                    }catch (Exception ex)
                    {
                        showMessage("エラー:\n" + ex.Message);
                    }
                }
                    );
            }
            catch (Exception ex)
            {
                showMessage("エラー:\n" + ex.Message);
            }
        }
Ejemplo n.º 2
0
 public void GetSpecListTest()
 {
     var repo = new SpecDocMetaInfoRepository();
     var list = repo.GetSpecList();
 }