public int DependancyDepth(int recurse = 0) { if (_depth.HasValue) { return(_depth.Value); } int d = 0; if (Dependancy != null) { d = Dependancy.DependancyDepth(recurse + 1); } foreach (var v in Parameters) { int e = v.Value.DependancyDepth(recurse + 1); if (e > d) { d = e; } } _depth = d; return(d); }
public int DependancyDepth(int recurse = 0) { if (_depth.HasValue) { return(_depth.Value); } int d = 0; if (Dependancy != null) { d = Dependancy.DependancyDepth(recurse + 1); } _depth = d; return(d); }
public int DependancyDepth(int recurse = 0) { if (recurse > 20) { _depth = recurse; } if (_depth.HasValue) { return(_depth.Value); } int d = 0; if (BaseClass != null) { d = BaseClass.DependancyDepth(recurse + 1) + 1; } foreach (var c in Interfaces) { int e = c.DependancyDepth() + 1; if (e > d) { d = e; } } foreach (var v in Methods) { int e = v.DependancyDepth(recurse + 1) + 1; if (e > d) { d = e; } } _depth = (HasEngine ? d + 1 : d); return(_depth.Value); }