示例#1
0
 ///
 public bool WorksInvokingCommand(CommandLineEventArgs e)
 {
     if (InvokingCommand == null)
     {
         return(false);
     }
     if (e != null)
     {
         InvokingCommand(this, e);
     }
     return(true);
 }
示例#2
0
文件: Panel.cs 项目: pezipink/FarNet
 ///
 public bool WorksInvokingCommand(CommandLineEventArgs e)
 {
     if (InvokingCommand == null)
         return false;
     if (e != null)
         InvokingCommand(this, e);
     return true;
 }
示例#3
0
        /// <summary>
        /// Calls base or assigns a value to the current property.
        /// </summary>
        void OnInvokingCommand(object sender, CommandLineEventArgs e)
        {
            // base
            string code = e.Command.TrimStart();
            if (!code.StartsWith("=", StringComparison.Ordinal))
                return;

            // we do
            e.Ignore = true;

            // skip empty
            FarFile f = CurrentFile;
            if (f == null)
                return;
            PSPropertyInfo pi = f.Data as PSPropertyInfo;
            if (pi == null)
                return;

            try
            {
                SetUserValue(pi, code.Substring(1));
                UpdateRedraw(true);
            }
            catch (RuntimeException ex)
            {
                A.Message(ex.Message);
            }
        }