예제 #1
0
파일: Exceptions.cs 프로젝트: resc/redpipes
 public void Accept(IGraphBuilder <IPipe> visitor)
 {
     visitor.GetOrAddNode(this, (Keys.Name, _name));
     if (visitor.AddEdge(this, _next, (Keys.Name, "Next")))
     {
         _next.Accept(visitor);
     }
 }
예제 #2
0
파일: Branch.cs 프로젝트: resc/redpipes
            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);
            }
예제 #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);
                }
            }
예제 #4
0
파일: Branch.cs 프로젝트: resc/redpipes
            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);
                }
            }
예제 #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);
                }
            }
예제 #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));
            }
예제 #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);
                    }
                }
            }
예제 #8
0
파일: Builder.cs 프로젝트: resc/redpipes
 /// <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));
 }
예제 #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);
 }