public virtual void Write(ICodeFragment fragment, IOutputCache output) { BaseTypeTemplate baseType = (BaseTypeTemplate)fragment; if (baseType == null) { return; } output.Add(/*fragments.Any(x => x.Code.Contains(":")) ? ", " :*/ " : ") .Add(baseType.ToType()); }
public virtual void Write(ICodeFragment fragment, IOutputCache output) { BaseTypeTemplate template = (BaseTypeTemplate)fragment; if (template == null) { return; } TypeTemplate type = template.ToType(); if (output.LastFragments.Skip(2).FirstOrDefault() is BaseTypeTemplate baseType && baseType.ToType().IsInterface == type.IsInterface) { output.Add(", "); }
public virtual void Write(ICodeFragment fragment, IOutputCache output) { BaseTypeTemplate template = (BaseTypeTemplate)fragment; if (template == null) { return; } TypeTemplate type = template.ToType(); BaseTypeTemplate previousBaseTypeTemplate = output.LastFragments.TakeWhile(x => !Equals(x, template.Parent)).OfType <BaseTypeTemplate>().FirstOrDefault(x => x != template); if (previousBaseTypeTemplate?.ToType().IsInterface == type.IsInterface) { output.Add(", "); } else { output.Add(type.IsInterface && !template.Parent.IsInterface ? implements : extends); } output.Add(type); }