Beispiel #1
0
            T IDebuggable.GetDebugInfo <T>(int parentDepth, int childDepth)
            {
                var result = new DebugDataSupply
                {
                    Instance        = this,
                    IsStatic        = IsStatic,
                    SubscriberCount = _onSupplyActions.Count,
                    SuppliedData    = new DebugDataScope
                    {
                        DataType  = Dependency.DataType,
                        ScopeName = Dependency.ScopeName
                    },
                };

                if (parentDepth != 0)
                {
                    result.Supplier = DataSupplier.GetDebugInfo <DebugDataSupplier>(parentDepth - 1, 0);
                }

                return(result as T);
            }
Beispiel #2
0
        public SupplyDrawing(DebugDataSupply supply)
        {
            CssClass = "list";

            var lines = new List <string>();

            if (!string.IsNullOrEmpty(supply.Name))
            {
                lines.Add("Supply '" + supply.Name + "'");
            }

            var description = supply.IsStatic ? "Static" : "Dynamic";

            if (supply.SuppliedData != null && supply.SuppliedData.HasData())
            {
                description += " supply of " + supply.SuppliedData;
            }

            if (supply.SubscriberCount > 0)
            {
                description += " with " + supply.SubscriberCount + " subscribers";
            }

            lines.Add(description);

            if (supply.Instance != null)
            {
                lines.Add("Implemented by " + supply.Instance.GetType().DisplayName());
            }

            AddChild(new TextDrawing {
                Text = lines.ToArray()
            });

            if (supply.Supplier != null && supply.Supplier.HasData())
            {
                AddChild(new SupplierDrawing(supply.Supplier));
            }
        }