private void _SerializeOptions(IReadOnlyList <IOption> options, LinkedList <string> argList, OnSerialized?onSerialized) { foreach (var option in options) { var obj = onSerialized?.Invoke(option); var optionPrefix = option.LongName != null ? $"--{option.LongName}" : $"-{option.ShortName}"; // LongName优先 if (option.ValueType == ValueType.Non) { if (mValueSerializer.SerializeNonValue(this, option.ObjType, obj)) { argList.AddLast(optionPrefix); } continue; } if (option.ValueType == ValueType.Single) { argList.AddLast($"{optionPrefix}"); argList.AddLast(mValueSerializer.SerializeSingleValue(this, option.ObjType, obj)); continue; } if (option.ValueType == ValueType.Multi) { foreach (string value in mValueSerializer.SerializeMultiValue(this, option.ObjType, obj)) { argList.AddLast($"{optionPrefix}"); argList.AddLast(value); } continue; } if (option.ValueType == ValueType.Sequence) { argList.AddLast($"{optionPrefix}"); foreach (string value in mValueSerializer.SerializeMultiValue(this, option.ObjType, obj)) { argList.AddLast(value); } // ReSharper disable once RedundantJumpStatement continue; } } }