Exemplo n.º 1
0
        bool TryInlineScalar(YamlScalar obj, int maximumWidth, out string result)
        {
            result = obj.ToString();
            if (result.Length > maximumWidth)
            {
                result = null;
            }

            return(result != null);
        }
Exemplo n.º 2
0
 void WriteScalar(YamlScalar obj)
 {
     if (TryInlineScalar(obj, _maximumWidth - _indentColumn, out var inlined))
     {
         WriteInline(inlined);
     }
     else
     {
         Write(obj.ToString());
     }
 }