コード例 #1
0
        bool TryInlineScalar(YamlScalar obj, int maximumWidth, out string result)
        {
            result = obj.ToString();
            if (result.Length > maximumWidth)
            {
                result = null;
            }

            return(result != null);
        }
コード例 #2
0
 void WriteScalar(YamlScalar obj)
 {
     if (TryInlineScalar(obj, _maximumWidth - _indentColumn, out var inlined))
     {
         WriteInline(inlined);
     }
     else
     {
         Write(obj.ToString());
     }
 }