Mapsui.Geometries.MultiLineString.IsEmpty C# (CSharp) Method

IsEmpty() public method

If true, then this Geometry represents the empty point set, Ø, for the coordinate space.
public IsEmpty ( ) : bool
return bool
        public override bool IsEmpty()
        {
            if ((LineStrings == null) || (LineStrings.Count == 0))
                return true;

            foreach (var lineString in LineStrings)
            {
                if (!lineString.IsEmpty())
                    return false;
            }

            return true;
        }

Usage Example

Example #1
0
 /// <summary>
 /// Converts a MultiLineString to &lt;MultiLineString Text&gt;
 /// format, then Appends it to the writer.
 /// </summary>
 /// <param name="multiLineString">The MultiLineString to process.</param>
 /// <param name="writer">The output stream writer to Append to.</param>
 private static void AppendMultiLineStringText(MultiLineString multiLineString, StringWriter writer)
 {
     if (multiLineString == null || multiLineString.IsEmpty())
         writer.Write("EMPTY");
     else
     {
         writer.Write("(");
         for (int i = 0; i < multiLineString.LineStrings.Count; i++)
         {
             if (i > 0)
                 writer.Write(", ");
             AppendLineStringText(multiLineString[i], writer);
         }
         writer.Write(")");
     }
 }