LunarMind/Commands/Paste.cs

(开头部分) 46KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using Microsoft.Win32;
using System.Windows;
using System.Xml;
using WinForm = System.Windows.Forms;
using System.IO;

namespace SHomeWorkshop.LunarMind.Commands
{
    /// <summary>
    /// 以此类为模板,制作自定义命令类
    ///     共需要修改10处!!!
    /// ==============================
    /// 
    /// 粘贴命令。
    /// ★①,修改类名。
    /// </summary>
    public static class PasteCommand
    {
        private static RoutedUICommand routedUICmd;//创建私有字段

        public static RoutedUICommand RoutedUICmd//创建只读静态属性
        {
            get { return routedUICmd; }
        }

        /// <summary>
        /// ★②,修改静态构造方法名。
        /// </summary>
        static PasteCommand()//类型构造器
        {
            //★③,修改两个字符串参数名。★④以及第三个参数的类型名。
            routedUICmd = new RoutedUICommand("PasteCommand", "PasteCommand",
                typeof(PasteCommand),//创建RoutedUICommand对象
                new InputGestureCollection()
                { 
                    //★⑤,修改此处两个参数,以便挂接快捷键。
                    new KeyGesture(Key.V,ModifierKeys.Control,"Ctrl+V")
                });

            cmdBinding.Command = routedUICmd;
            cmdBinding.CanExecute += new CanExecuteRoutedEventHandler(cmdBinding_CanExecute);
            cmdBinding.Executed += new ExecutedRoutedEventHandler(cmdBinding_Executed);
        }

        private static CommandBinding cmdBinding = new CommandBinding();

        public static CommandBinding CmdBinding
        {
            get { return cmdBinding; }
        }

        static void cmdBinding_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            //★⑦,修改此方法的实现。

后面还有 1050 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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