예제 #1
0
 public bool Equals(ChainDetailsRequest other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(other.Hash.Equals(Hash));
 }
예제 #2
0
        public Dictionary <string, object> get_chain_details_Hash(ChainDetailsRequest request)
        {
            var dict = new Dictionary <string, object>();

            var chain = _graph.Behaviors.FirstOrDefault(x => x.GetHashCode() == request.Hash);

            if (chain == null)
            {
                dict.Add("not-found", true);
                return(dict);
            }

            dict.Add("details", EndpointReport.ForChain(chain).ToDictionary());

            if (chain is RoutedChain)
            {
                var routed      = chain.As <RoutedChain>();
                var description = Description.For(routed.Route);


                dict.Add("route", new DescriptionBodyTag(description).ToString());
            }

            var nodes = chain.NonDiagnosticNodes().Select(x => {
                return(new Dictionary <string, object>
                {
                    { "title", Description.For(x).Title },
                    { "details", _visualizer.Visualize(x).ToString() },
                    { "category", x.Category.ToString() }
                });
            });

            dict.Add("nodes", nodes);


            return(dict);
        }