コード例 #1
0
        protected override T PopulateDebugInfo <T>(DebugInfo debugInfo, int parentDepth, int childDepth)
        {
            _dataScopeRules.ElementName = "Page " + Name;

            if (typeof(T).IsAssignableFrom(typeof(DebugPage)))
            {
                var debugPage = debugInfo as DebugPage ?? new DebugPage();

                debugPage.RequiredPermission = RequiredPermission;
                debugPage.DataContext        = _dataContextBuilder.GetDebugInfo <DebugDataScopeRules>(0, -1);
                debugPage.Scope = _dataScopeRules.GetDebugInfo <DebugDataScopeRules>(0, -1);

                if (childDepth != 0)
                {
                    debugPage.Layout = _layout.GetDebugInfo <DebugLayout>(0, childDepth - 1);
                }

                return(base.PopulateDebugInfo <T>(debugPage, parentDepth, childDepth));
            }

            if (typeof(T).IsAssignableFrom(typeof(DebugDataScopeRules)))
            {
                var debugDataScopeRules = _dataScopeRules.GetDebugInfo <T>(parentDepth, childDepth);
                return(base.PopulateDebugInfo <T>(debugDataScopeRules, parentDepth, childDepth));
            }

            if (typeof(T).IsAssignableFrom(typeof(DebugDataConsumer)))
            {
                var debugDataConsumer = _dataConsumer.GetDebugInfo <T>(parentDepth, childDepth);
                return(base.PopulateDebugInfo <T>(debugDataConsumer, parentDepth, childDepth));
            }

            return(base.PopulateDebugInfo <T>(debugInfo, parentDepth, childDepth));
        }