Esempio n. 1
0
        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());
        }
Esempio n. 2
0
        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}");
        }
Esempio n. 3
0
        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}");
        }