Ejemplo n.º 1
0
        private string StringFromPayloadString(PayloadString t)
        {
            StringBuilder sb  = new StringBuilder();
            string        val = t.value;

            sb.Append(Syntax.STRING_CONTAINER);
            for (int i = 0; i < val.Length; i++)
            {
                // If it is escapable, append the escaped sequence.
                if (Syntax.IsEscapable(val[i]))
                {
                    sb.Append(Syntax.GetEscaped(val[i]));
                }
                // Otherwise, append just the char.
                else
                {
                    sb.Append(val[i]);
                }
            }
            sb.Append(Syntax.STRING_CONTAINER);
            return(sb.ToString());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new tag of type String with the specified name and payload.
 /// </summary>
 /// <param name="name">The name of the new Tag.</param>
 /// <param name="payload">The payload of the new Tag.</param>
 public TagString(string name, PayloadString payload) : base(name)
 {
     this.payload = payload;
     payload.EmbedIn(this);
 }