Exemplo n.º 1
0
 public void Accept(IGraphBuilder <IPipe> visitor)
 {
     visitor.GetOrAddNode(this, (Keys.Name, _name));
     if (visitor.AddEdge(this, _next, (Keys.Name, "Next")))
     {
         _next.Accept(visitor);
     }
 }
Exemplo n.º 2
0
            public override void Accept(IGraphBuilder <IBuilder> visitor)
            {
                var type = (_isAlternate ? "Alternate" : "Branch");

                visitor.GetOrAddNode(this, (Keys.Name, $"{type}: {Name}"));
                visitor.AddEdge(this, _trueBranch, (Keys.Name, "True " + type));
                visitor.AddEdge(this, _falseBranch, (Keys.Name, "False" + type));
                _trueBranch.Accept(visitor);
                _falseBranch.Accept(visitor);
            }
Exemplo n.º 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);
                }
            }
Exemplo n.º 4
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);
                }
            }
Exemplo n.º 5
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);
                }
            }
Exemplo n.º 6
0
            public void Accept(IGraphBuilder <IPipe> visitor)
            {
                visitor.GetOrAddNode(this, (Keys.Name, _name));
                var list = new List <IPipe>(_cases.Count + 1);

                foreach (var kv in _cases.OrderBy(kv => kv.Key))
                {
                    var target = kv.Value;
                    visitor.AddEdge(this, target, (Keys.Name, $"Case '{kv.Key}':"));
                    list.Add(target);
                }

                visitor.AddEdge(this, _defaultCase, (Keys.Name, $"Default:"));
                list.Add(_defaultCase);
                list.ForEach(p => p.Accept(visitor));
            }
Exemplo n.º 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);
                    }
                }
            }
Exemplo n.º 8
0
 /// <summary>
 /// Override <see cref="Accept"/> so that the debugger tools
 /// can generate a pretty picture of the builder structure.
 /// See <see cref="IGraphBuilder{T}.AddEdge"/> and
 /// <see cref="IGraphBuilder{T}.GetOrAddNode"/> for more information.
 /// </summary>
 public virtual void Accept(IGraphBuilder <IBuilder> visitor)
 {
     visitor.GetOrAddNode(this, (Keys.Name, Name));
 }
Exemplo n.º 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);
 }