Beispiel #1
0
 public void Accept(IGraphBuilder <IPipe> visitor)
 {
     if (visitor.AddEdge(this, _next, (Keys.Name, "Next")))
     {
         _next.Accept(visitor);
     }
 }
Beispiel #2
0
 public void Accept(IGraphBuilder <IPipe> visitor)
 {
     visitor.GetOrAddNode(this, (Keys.Name, _name));
     if (visitor.AddEdge(this, _next, (Keys.Name, "Next")))
     {
         _next.Accept(visitor);
     }
 }
Beispiel #3
0
            public void Accept(IGraphBuilder <IPipe> visitor)
            {
                var name = _name ?? $"Transform ({nameof(IContext)}, {typeof(TIn).GetCSharpName()}) => ({nameof(IContext)}, {typeof(TOut).GetCSharpName()})";

                visitor.GetOrAddNode(this, (Keys.Name, name));
                if (visitor.AddEdge(this, _next, (Keys.Name, "Next")))
                {
                    _next.Accept(visitor);
                }
            }
Beispiel #4
0
            public void Accept(IGraphBuilder <IPipe> visitor)
            {
                if (visitor.AddEdge(this, _accept, (Keys.Name, "Accept")))
                {
                    _accept.Accept(visitor);
                }

                if (visitor.AddEdge(this, _deny, (Keys.Name, "Deny")))
                {
                    _deny.Accept(visitor);
                }
            }
Beispiel #5
0
            public void Accept(IGraphBuilder <IPipe> visitor)
            {
                visitor.GetOrAddNode(this, (Keys.Name, _conditionDescription));
                if (visitor.AddEdge(this, _trueBranch, (Keys.Name, "True")))
                {
                    _trueBranch.Accept(visitor);
                }

                if (visitor.AddEdge(this, _falseBranch, (Keys.Name, "False")))
                {
                    _falseBranch.Accept(visitor);
                }
            }
Beispiel #6
0
            public void Accept(IGraphBuilder <IPipe> visitor)
            {
                visitor.GetOrAddNode(this
                                     , (Keys.Name, $"Trace activity '{_name}' ({_kind})")
                                     , ("DiagnosticsName", _name)
                                     , ("DiagnosticsKind", _kind)
                                     , ("DiagnosticsSource", $"{_source.Name} {_source.Version}"));

                if (visitor.AddEdge(this, _next, (Keys.Name, "Next")))
                {
                    _next.Accept(visitor);
                }
            }
Beispiel #7
0
            public void Accept(IGraphBuilder <IPipe> visitor)
            {
                var label = $"Remote Procedure Call ({typeof(TRequest).GetCSharpName()} request) => ({typeof(TResponse).GetCSharpName()} response)\nendpoint: {_options.EndPoint}";

                visitor.GetOrAddNode(this, (Keys.Name, label));
                if (visitor.AddEdge(this, _onResponse, (Keys.Name, "Response")))
                {
                    _onResponse.Accept(visitor);
                }

                if (_onException != null)
                {
                    if (visitor.AddEdge(this, _onException, (Keys.Name, "Exception")))
                    {
                        _onException.Accept(visitor);
                    }
                }
            }
Beispiel #8
0
        /// <summary> Renders the pipe structure as a JSON string. </summary>
        public static string DumpPipeStructure(this IPipe pipe)
        {
            var scope = new Scope();

            var g = new DgmlGraph <IPipe>();

            pipe.Accept(g);

            var rootNode = g.GetOrAddNode(pipe);

            DumpPipeStructure(rootNode, scope, new HashSet <INode>());
            var opts = new JsonSerializerOptions
            {
                WriteIndented = true,
                Encoder       = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,// just so that < and > don't get encoded...
            };

            return(JsonSerializer.Serialize(scope, opts));
        }
Beispiel #9
0
 public void Accept(IGraphBuilder <IPipe> visitor)
 {
     visitor.GetOrAddNode(this, (Keys.Name, $"Print {typeof(T).GetCSharpName()} to console"));
     visitor.AddEdge(this, _next, (Keys.Name, "Next"));
     _next.Accept(visitor);
 }