예제 #1
0
        public void Execute(object parameter)
        {
            object[]            parameters    = (object[])parameter;
            MainWindowViewModel mainViewModel = (MainWindowViewModel)parameters[0];
            int type = (int)parameters[1];

            string filePath = (type < 2) ? myFilePathProvider.GetOpenFilePath() : myFilePathProvider.GetSaveFilePath();

            if (!String.IsNullOrWhiteSpace(filePath))
            {
                switch (type)
                {
                case 0:
                    mainViewModel.DailyReportFilePath = filePath;
                    break;

                case 1:
                    mainViewModel.UnallocatedCashReportFilePath = filePath;
                    break;

                case 2:
                    mainViewModel.OutputFilePath = filePath;
                    break;

                default:
                    throw new NotSupportedException();
                }
            }
        }
예제 #2
0
        private void OnOpen(object sender, EventArgs e)
        {
            var filePath = _filePathProvider.GetOpenFilePath();

            if (string.IsNullOrEmpty(filePath))
            {
                return;
            }

            Open(filePath);
        }