private void SetValueOfInputItemsIntoForm()
        {
            MaterialLicenseChecker.Models.LicenseTextInputsItemsData FetchedInputItems = new MaterialLicenseChecker.Models.LicenseTextInputsItemsData();
            GetSavedInputItems cmd = new GetSavedInputItems();

            cmd.FetchedInputItemsData = FetchedInputItems;
            RecevierOfViewModel.CommandViewModelTo(cmd);

            ExportedLicenseTextFilePath.Text = cmd.FetchedInputItemsData.ExportingDirectory;
            ExportedLicenseTextFileName.Text = cmd.FetchedInputItemsData.FileName;
            FooterText.Text = cmd.FetchedInputItemsData.FooterText;
            HeaderText.Text = cmd.FetchedInputItemsData.HeaderText;
        }
Exemplo n.º 2
0
        private void ClickedGenerateButton(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrWhiteSpace(ProjectName.Text))
            {
                MessageBox.Show("プロジェクト名を入力してください", "警告", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            if (string.IsNullOrWhiteSpace(ProjectFileLocation.Text))
            {
                MessageBox.Show("プロジェクト作成先を入力してください。", "警告", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            //プロジェクト名にファイル名として使用できない文字が含まれている場合
            if (!(ProjectName.Text.IndexOfAny(System.IO.Path.GetInvalidFileNameChars()) < 0))
            {
                MessageBox.Show("プロジェクト名に不正な文字が含まれています。\nプロジェクト名を変更してください。", "作成失敗", MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            try
            {
                var cmd = new GenerateProjectFile();
                cmd.GeneratedProjectFileAbsolutePath = ProjectFileLocation.Text;
                cmd.ProjectName = ProjectName.Text;

                RecevierOfViewModel.CommandViewModelTo(cmd);

                //これが原因だぁーーーーーー!!!!!!!
                MaterialLicenseChecker.Views.CMainView.IReceiverCommandFromView ReceiverOfView = (MaterialLicenseChecker.Views.CMainView.IReceiverCommandFromView) this.Owner;
                MaterialLicenseChecker.Views.CMainView.LoadProjectFiles         ViewCmd        = new MaterialLicenseChecker.Views.CMainView.LoadProjectFiles();
                ViewCmd.LoadedProjectFileAbsolutePath = ProjectFileLocation.Text + "\\" + ProjectName.Text + "\\" + ProjectName.Text + ".projm";
                ViewCmd.ProjectName = ProjectName.Text;
                ReceiverOfView.CommandViewTo(ViewCmd);
                Close();
            }
            catch (MyException.SameNameProjectExistsException)
            {
                MessageBox.Show("既に同名のプロジェクトが存在します。\nプロジェクト名を変更してください。", "作成失敗", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
        }