Exemplo n.º 1
0
 internal Content(string String, Support.Content.ContentType ContentType, IMessageDelimiters CustomDelimiters)
     : base(CustomDelimiters)
 {
     _Temporary       = true;
     _Index           = null;
     _Parent          = null;
     this.ContentType = ContentType;
     if (ValidateData(String))
     {
         if (String != String.Empty)
         {
             _Data = String;
             if (ContentType == Support.Content.ContentType.Escape)
             {
                 _EscapeMetaData = new EscapeData(String);
             }
             else
             {
                 _EscapeMetaData = null;
             }
             SetParent();
         }
         else
         {
             if (ContentType == Support.Content.ContentType.Escape)
             {
                 throw new PeterPiperException("Attempt to set Content as type 'Escape' yet Content String was empty. Escape type content must have data provided");
             }
         }
     }
 }
Exemplo n.º 2
0
 public static IContent Content(string String, Support.Content.ContentType ContentType, IMessageDelimiters CustomDelimiters)
 {
     return(new Content(String, ContentType, CustomDelimiters));
 }
Exemplo n.º 3
0
 public static IContent Content(string String, Support.Content.ContentType ContentType)
 {
     return(new Content(String, ContentType));
 }