private void OnSerializing(StreamingContext ctx) { endIndex = strLen - 1; nextTextElementLen = currTextElementLen; }