コード例 #1
0
            public static bool TryFromJson(JToken token, out InvokeFileInvocation invocation)
            {
                if (token.Type == JTokenType.Object && token["invoke-file"] != null)
                {
                    invocation = new InvokeFileInvocation(token.Value <string>("invoke-file") ?? "");
                    return(true);
                }

                invocation = default;
                return(false);
            }
コード例 #2
0
            static bool TryGetInvocation(JToken json, out Invocation result)
            {
                if (json["invokeFile"] != null)
                {
                    result = new InvokeFileInvocation(json.Value <string>("invokeFile"));
                    return(true);
                }

                if (OracleResponseInvocation.TryFromJson(json["oracleResponse"], out var oracleInvocation))
                {
                    result = oracleInvocation;
                    return(true);
                }

                if (LaunchInvocation.TryFromJson(json, out var launchInvocation))
                {
                    result = launchInvocation;
                    return(true);
                }

                result = default;
                return(false);
            }