Automation/Scripts/ScriptResult.cs

(开头部分) 2KB

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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ComLib.Automation
{
    /// <summary>
    /// Result of a script execution.
    /// </summary>
    public class ScriptResult : RunResult
    {
        /// <summary>
        /// Initialize
        /// </summary>
        /// <param name="started">Start time of script</param>
        /// <param name="ended">End time of script.</param>
        /// <param name="success">Whether or not the script execution was successful</param>
        /// <param name="message">A combined message of all the errors.</param>
        public ScriptResult(DateTime started, DateTime ended, bool success, string message)
            : base(started, ended, success, message)
        {
        }


        /// <summary>
        /// Name of the script.
        /// </summary>
        public string Name { get; set; }


        /// <summary>
        /// Filepath of the script.
        /// </summary>
        public string FilePath { get; set; }


        /// <summary>
        /// List of results for each command.
        /// </summary>
        public List<CommandResult> CommandResults { get; set; }


        /// <summary>
        /// Get the return value of a specific command.
        /// </summary>
        /// <param name="refkey"></param>
        /// <returns></returns>
        public object ValueForRefKey(string refkey)
        {
            var cmdOutput = (from result in CommandResults 
                           where string.Compare(result.RefKey, refkey) == 0 
                           select result.Item).SingleOrDefault<object>();
            return cmdOutput;
        }


        /// <summary>
        /// Gets the combined output of each command result
        /// </summary>
后面还有 15 行代码,解锁后查看完整代码

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

AI 解读

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

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