/// <summary> /// Gets the kind of whitespace that can potentially be within the whitespace margin. /// </summary> /// <param name="lines">The text lines to analyze.</param> public static WhiteSpacePresence GetMarginKind(string[] lines) { WhiteSpacePresence presence = WhiteSpacePresence.None; foreach (var line in lines) { if (line == null) { continue; } foreach (char c in line) { switch (c) { case '\t': presence |= WhiteSpacePresence.Tab; break; case ' ': presence |= WhiteSpacePresence.Space; break; default: continue; } } } return(presence); }
/// <summary> /// Initializes a new instance of the <see cref="ProcessLinesResults"/> class /// with the specified arguments. /// </summary> /// <param name="lines">The lines after they have been processed.</param> /// <param name="whiteSpacePresence">What whitespace was present in the lines.</param> public ProcessLinesResults(string[] lines, WhiteSpacePresence whiteSpacePresence) { Lines = lines; WhiteSpacePresence = whiteSpacePresence; }