Exemplo n.º 1
0
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();

            if (!string.IsNullOrEmpty(Name))
            {
                builder.Append("[Name: " + Name + ", ");
            }
            if (!string.IsNullOrEmpty(Grammar))
            {
                if (builder.Length == 0)
                {
                    builder.Append("[Grammar: " + Grammar + ", ");
                }
                else
                {
                    builder.Append("Grammar: " + Grammar + ", ");
                }
            }
            if (builder.Length == 0)
            {
                return("[LanguageCode: " + LanguageCode + ", Phrases: " + string.Join(",", Phrases.ToArray()) + "]");
            }
            else
            {
                builder.Append("LanguageCode: " + LanguageCode + ", Phrases: " + string.Join(",", Phrases.ToArray()) + "]");
                return(builder.ToString());
            }
        }