Example #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");
             }
         }
     }
 }
Example #2
0
 internal Content(IEscapeData EscapeMetaData)
 {
     _Temporary       = true;
     _Index           = null;
     _Parent          = null;
     this.ContentType = Support.Content.ContentType.Escape;
     _EscapeMetaData  = EscapeMetaData as EscapeData;
     _Data            = String.Format("{0}{1}", _EscapeMetaData.EscapeTypeCharater, _EscapeMetaData.MetaData);
     SetParent();
 }
Example #3
0
 /// <summary>
 /// Set Content as HL7 Standard escape
 /// </summary>
 /// <param name="EscapeType"></param>
 internal Content(Support.Standard.EscapeType EscapeType)
 {
     _Temporary       = true;
     _Index           = null;
     _Parent          = null;
     this.ContentType = Support.Content.ContentType.Escape;
     _EscapeMetaData  = new EscapeData(EscapeType, String.Empty);
     _Data            = _EscapeMetaData.EscapeTypeCharater.ToString();
     SetParent();
 }
Example #4
0
 internal Content(Support.Standard.EscapeType EscapeType, MessageDelimiters CustomDelimiters,
                  bool Temporary, int?Index, ModelBase Parent)
     : base(CustomDelimiters)
 {
     _Temporary           = Temporary;
     _Index               = Index;
     _Parent              = Parent;
     _InternalContentType = ModelSupport.ContentTypeInternal.Escape;
     _EscapeMetaData      = new EscapeData(EscapeType, String.Empty);
     _Data = Support.Standard.Escapes.ResolveEscapeChararter(EscapeType).ToString();
     SetParent();
 }
Example #5
0
 /// <summary>
 /// Set a Content to normal text, defaults to ContentType = TEXT
 /// </summary>
 /// <param name="String"></param>
 internal Content(string String)
 {
     _Temporary       = true;
     _Index           = null;
     _Parent          = null;
     this.ContentType = Support.Content.ContentType.Text;
     _EscapeMetaData  = null;
     if (ValidateData(String))
     {
         if (String != String.Empty)
         {
             _Data = String;
             SetParent();
         }
     }
 }
Example #6
0
 //Only internal Constructors
 internal Content(string String, ModelSupport.ContentTypeInternal ContentTypeInternal,
                  MessageDelimiters CustomDelimiters, bool Temporary, int?Index, ModelBase Parent)
     : base(CustomDelimiters)
 {
     _Temporary           = Temporary;
     _Index               = Index;
     _Parent              = Parent;
     _InternalContentType = ContentTypeInternal;
     if (ContentTypeInternal == ModelSupport.ContentTypeInternal.EncodingCharacters)
     {
         SetDataToEncodingCharacters();
         _EscapeMetaData = null;
     }
     else if (ContentTypeInternal == ModelSupport.ContentTypeInternal.MainSeparator)
     {
         SetDataToMainSeparator();
         _EscapeMetaData = null;
     }
     else if (ContentTypeInternal == ModelSupport.ContentTypeInternal.Escape)
     {
         if (String != String.Empty)
         {
             if (ValidateData(String))
             {
                 _Data           = String;
                 _EscapeMetaData = new EscapeData(String);
             }
             SetParent();
         }
         else
         {
             throw new PeterPiperException("Attempt to set Content as Escape Type yet no Content data given, String was empty.");
         }
     }
     else
     {
         if (String != String.Empty)
         {
             if (ValidateData(String))
             {
                 _EscapeMetaData = null;
                 _Data           = String;
             }
             SetParent();
         }
     }
 }
Example #7
0
 internal Content(string String, MessageDelimiters CustomDelimiters, bool Temporary, int?Index,
                  ModelBase Parent)
     : base(CustomDelimiters)
 {
     _Temporary           = Temporary;
     _Index               = Index;
     _Parent              = Parent;
     _InternalContentType = ModelSupport.ContentTypeInternal.Text;
     _EscapeMetaData      = null;
     if (ValidateData(String))
     {
         if (String != String.Empty)
         {
             _Data = String;
             SetParent();
         }
     }
 }