示例#1
0
        private void DisplayedTextValue(FindValueEventArgs e, bool isSource = true)
        {
            // UI操作を停止
            this.EnabledUI(false);

            var rows = this.Model.Select((this.menuUnTranslatedOnly.IsChecked)
                                                                                        ? "TargetValue = '' OR SourceValue = TargetValue"
                                                                                        : "");

            Task.Factory.StartNew(index =>
            {
                // 検索
                return(DAC.ResxTranslatorDataSet.FindRow(
                           rows,
                           (int)index,
                           e.SearchText,
                           e.IsUpperVector,
                           e.StrComp,
                           isSource
                           ));
            }, this.contentList.SelectedIndex)
            .ContinueWith(_ =>
            {
                this.Dispatcher.BeginInvoke(new Action <System.Data.DataRow>(row =>
                {
                    // UI操作を開始
                    this.EnabledUI(true);

                    // 結果
                    if (null != row)
                    {
                        // 行操作
                        this.contentList.SelectedItem = row;
                        this.contentList.ScrollIntoView(row);
                    }
                    else
                    {
                        string msg = string.Format("{0} は見つかりませんでした。", e.SearchText);

                        System.Windows.MessageBox.Show(
                            this,
                            msg,
                            this.Title,
                            MessageBoxButton.OK,
                            MessageBoxImage.Information);
                    }
                }),
                                            _.Result);
            });
        }
示例#2
0
 private void FindTargetValueEvent(object sender, FindValueEventArgs e)
 {
     this.DisplayedTextValue(e, false);
 }
示例#3
0
 private void FindSourceValueEvent(object sender, FindValueEventArgs e)
 {
     this.DisplayedTextValue(e);
 }