private string GetFullName(string name, string lastName, string middleName, string separator) { var result = new StringBuilder(); if (!string.IsNullOrWhiteSpace(lastName)) { result.Append(lastName.Trim()); result.Append(separator); } result.Append(name.Trim()); if (!string.IsNullOrWhiteSpace(middleName)) { result.Append(separator); result.Append(middleName.Trim()); } if (!string.IsNullOrWhiteSpace(NamePrefix)) { result.Append(separator); result.Append(NamePrefix.Trim()); } return(result.ToString()); }
public override string ToString() { bool hasPlaceholder = Type.Contains("{0}"); if (hasPlaceholder) { return(string.Format(Type, $"{NamePrefix}{Name}{NameSuffix}")); } var namePrefix = (Name.Length > 0) ? $"{NamePrefix} " : NamePrefix.ToString(); return($"{Type}{namePrefix}{Name}{NameSuffix}"); }
public override string ToString() { if (Kind == GeneratorKind.TypeScript) { return($"{Name}{NameSuffix}: {Type}"); } var hasPlaceholder = Type.Contains("{0}"); if (hasPlaceholder) { return(string.Format(Type, $"{NamePrefix}{Name}{NameSuffix}")); } var namePrefix = (Name.Length > 0) ? $"{NamePrefix} " : NamePrefix.ToString(); return($"{Type}{namePrefix}{Name}{NameSuffix}"); }