LunarPresentation/Dialogs/ReplaceDialog.xaml.cs

(开头部分) 6KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Input;
using SHomeWorkshop.LunarPresentation.Commands;

namespace SHomeWorkshop.LunarPresentation.Dialogs
{
    /// <summary>
    /// ReplaceDialog.xaml 的交互逻辑
    /// </summary>
    public partial class ReplaceDialog : Window
    {
        public ReplaceDialog()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            tbxFindText.Focus();

            Globals.SwitchInputMethod(true);
        }

        private void btnNext_Click(object sender, RoutedEventArgs e)
        {
            Find();
        }

        private string preFindKeyword = null;

        //在查找结果列表中当前正被选中的那个。
        private int findResultPoint = -1;

        private List<Expressions.BaseText> findResultList = new List<Expressions.BaseText>();

        private void Find()
        {
            if (Globals.selectedEditor == null)
            {
                MessageBox.Show("当前没有打开任何文档。", Globals.appName,
                    MessageBoxButton.OK, MessageBoxImage.Warning);
                return;
            }

            //分情况:

            //⑴如果本次点击时,“查找内容”关键字没有发生变化,则说明是延续上次查找。
            //⑵如果“查找内容”关键字发生了变化,说明要开始一次全新的查找。
            //  找到后,生成一个新列表。



            if (preFindKeyword == null || tbxFindText.Text != preFindKeyword)
            {
                preFindKeyword = tbxFindText.Text;
                findResultList.Clear();
                findResultPoint = -1;
后面还有 152 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。