public string ToString(ScriptEntry.Mask <bool>?printMask = null) { var fg = new FileGeneration(); ToString(fg, printMask); return(fg.ToString()); }
public Mask <R> Translate <R>(Func <TItem, R> eval) { var ret = new ScriptEntry.Mask <R>(); this.Translate_InternalFill(ret, eval); return(ret); }
public void ToString(FileGeneration fg, ScriptEntry.Mask <bool>?printMask = null) { fg.AppendLine($"{nameof(ScriptEntry.Mask<TItem>)} =>"); fg.AppendLine("["); using (new DepthWrapper(fg)) { if (printMask?.Name ?? true) { fg.AppendItem(Name, "Name"); } if (printMask?.Flags ?? true) { fg.AppendItem(Flags, "Flags"); } if ((printMask?.Properties?.Overall ?? true) && Properties.TryGet(out var PropertiesItem)) { fg.AppendLine("Properties =>"); fg.AppendLine("["); using (new DepthWrapper(fg)) { fg.AppendItem(PropertiesItem.Overall); if (PropertiesItem.Specific != null) { foreach (var subItem in PropertiesItem.Specific) { fg.AppendLine("["); using (new DepthWrapper(fg)) { subItem?.ToString(fg); } fg.AppendLine("]"); } } } fg.AppendLine("]"); } } fg.AppendLine("]"); }