Пример #1
0
 /// <summary>
 /// Formats a property
 /// </summary>
 /// <param name="property">The property</param>
 /// <returns>The string representation of the property</returns>
 public virtual string Format(TsProperty property)
 {
     using (var sbc = new StringBuilderContext(this))
     {
         this.Write("{0}{1}: {2};", Format(property.Name), property.Optional?"?":"", Format(property.Type));
         return(sbc.ToString());
     }
 }
Пример #2
0
        public virtual string Format(TsProperty property)
        {
            using (var sbc = new StringBuilderContext(this))
            {
                this.WriteIndent();

                this.Write("{0}{2}: {1};", Format(property.Name), Format(property.Type),property.Optional ? "?" : "");
                this.WriteNewline();
                return sbc.ToString();
            }
        }