예제 #1
0
        /// <summary>
        /// 項目追加処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void AddActionCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            List <CsvComparisonViewModel.CsvRecord> vmList = new List <CsvComparisonViewModel.CsvRecord>(this.WVM.SelectedCsvComparisonVMList.Where((vm) => !vm.ActionId.HasValue).Select((vm) => vm.Record));

            if (vmList.Count() == 1)
            {
                CsvComparisonViewModel.CsvRecord record = vmList[0];
                ActionRegistrationWindow         arw    = new ActionRegistrationWindow(this.builder, this.WVM.SelectedBookVM.Id.Value, record);
                arw.Registrated += async(sender2, e2) => {
                    foreach (int value in e2.Value)
                    {
                        await this.ChangeIsMatchAsync(value, true);
                    }
                    await this.UpdateComparisonInfoAsync();

                    this.ActionsStatusChanged?.Invoke(this, new EventArgs());
                };
                arw.ShowDialog();
            }
            else
            {
                ActionListRegistrationWindow alrw = new ActionListRegistrationWindow(this.builder, this.WVM.SelectedBookVM.Id.Value, vmList);
                alrw.Registrated += async(sender2, e2) => {
                    foreach (int value in e2.Value)
                    {
                        await this.ChangeIsMatchAsync(value, true);
                    }
                    await this.UpdateComparisonInfoAsync();

                    this.ActionsStatusChanged?.Invoke(this, new EventArgs());
                };
                alrw.ShowDialog();
            }
        }
예제 #2
0
        /// <summary>
        /// 項目編集処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void EditActionCommand_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            ActionRegistrationWindow arw = new ActionRegistrationWindow(this.builder, this.WVM.SelectedCsvComparisonVM.ActionId.Value);

            arw.Registrated += async(sender2, e2) => {
                await this.UpdateComparisonInfoAsync();

                this.ActionsStatusChanged?.Invoke(this, new EventArgs());
            };
            arw.ShowDialog();
        }