Пример #1
0
        protected override object VisitIEnumerable(IEnumerableCallSite enumerableCallSite, CallSiteFormatterContext argument)
        {
            argument.WriteProperty("itemType", enumerableCallSite.ItemType);
            argument.WriteProperty("size", enumerableCallSite.ServiceCallSites.Length);

            if (enumerableCallSite.ServiceCallSites.Length > 0)
            {
                argument.StartProperty("items");

                CallSiteFormatterContext childContext = argument.StartArray();
                foreach (ServiceCallSite item in enumerableCallSite.ServiceCallSites)
                {
                    childContext.StartArrayItem();
                    VisitCallSite(item, childContext);
                }
                argument.EndArray();
            }
            return(null);
        }
Пример #2
0
        protected override object VisitConstructor(ConstructorCallSite constructorCallSite, CallSiteFormatterContext argument)
        {
            argument.WriteProperty("implementationType", constructorCallSite.ImplementationType);

            if (constructorCallSite.ParameterCallSites.Length > 0)
            {
                argument.StartProperty("arguments");

                CallSiteFormatterContext childContext = argument.StartArray();
                foreach (ServiceCallSite parameter in constructorCallSite.ParameterCallSites)
                {
                    childContext.StartArrayItem();
                    VisitCallSite(parameter, childContext);
                }
                argument.EndArray();
            }

            return(null);
        }