MimeKit.Header.EncodeDkimHeaderList C# (CSharp) Method

EncodeDkimHeaderList() static private method

static private EncodeDkimHeaderList ( MimeKit.FormatOptions format, StringBuilder encoded, int &lineLength, string value, char delim ) : void
format MimeKit.FormatOptions
encoded StringBuilder
lineLength int
value string
delim char
return void
		static void EncodeDkimHeaderList (FormatOptions format, StringBuilder encoded, ref int lineLength, string value, char delim)
		{
			var tokens = value.Split (delim);

			for (int i = 0; i < tokens.Length; i++) {
				if (i > 0) {
					encoded.Append (delim);
					lineLength++;
				}

				if (lineLength + tokens[i].Length + 1 > format.MaxLineLength) {
					encoded.Append (format.NewLine);
					encoded.Append ('\t');
					lineLength = 1;

					if (tokens[i].Length + 1 > format.MaxLineLength) {
						EncodeDkimLongValue (format, encoded, ref lineLength, tokens[i]);
					} else {
						lineLength += tokens[i].Length;
						encoded.Append (tokens[i]);
					}
				} else {
					lineLength += tokens[i].Length;
					encoded.Append (tokens[i]);
				}
			}
		}