Пример #1
0
 internal Component(ModelSupport.ContentTypeInternal ContentTypeInternal,
                    MessageDelimiters CustomDelimiters, bool Temporary, int?Index, ModelBase Parent)
     : base(CustomDelimiters)
 {
     _Temporary             = Temporary;
     _Index                 = Index;
     _Parent                = Parent;
     _SubComponentDictonary = ParseComponentRawStringToSubComponent(string.Empty, ContentTypeInternal);
 }
Пример #2
0
        internal Element(ModelSupport.ContentTypeInternal ContentTypeInternal, MessageDelimiters CustomDelimiters, bool Temporary, int?Index, ModelBase Parent)
            : base(CustomDelimiters)
        {
            _Temporary            = Temporary;
            _Index                = Index;
            _Parent               = Parent;
            _IsMainSeparator      = (ContentTypeInternal == ModelSupport.ContentTypeInternal.MainSeparator);
            _IsEncodingCharacters = (ContentTypeInternal == ModelSupport.ContentTypeInternal.EncodingCharacters);

            _RepeatDictonary = ParseElementRawStringToRepeat(string.Empty, ContentTypeInternal);
        }
Пример #3
0
 //Only internal Constructors
 internal Element(Field Field, MessageDelimiters CustomDelimiters, bool Temporary, int?Index, ModelBase Parent)
     : base(CustomDelimiters)
 {
     ValidateItemNotInUse(Field);
     _Temporary       = Temporary;
     _Index           = Index;
     _Parent          = Parent;
     _RepeatDictonary = new Dictionary <int, Field>();
     Field._Parent    = this;
     _RepeatDictonary.Add(1, Field);
 }
Пример #4
0
 //Only internal Constructors
 internal Component(SubComponent SubComponent, MessageDelimiters CustomDelimiters, bool Temporary,
                    int?Index, ModelBase Parent)
     : base(CustomDelimiters)
 {
     ValidateItemNotInUse(SubComponent);
     _Temporary             = Temporary;
     _Index                 = Index;
     _Parent                = Parent;
     _SubComponentDictonary = new Dictionary <int, SubComponent>();
     _SubComponentDictonary.Add(1, SubComponent);
 }
Пример #5
0
        //Only internal Constructors
        internal Field(string StringRaw, MessageDelimiters CustomDelimiters, bool Temporary, int?Index, ContentBase Parent)
            : base(CustomDelimiters)
        {
            _Temporary = Temporary;
            _Index     = Index;
            _Parent    = Parent;

            if (ValidateStringRaw(StringRaw))
            {
                _ComponentDictonary = ParseFieldRawStringToComponent(StringRaw, ModelSupport.ContentTypeInternal.Unknown);
            }
        }
Пример #6
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();
 }
Пример #7
0
        internal Element(string StringRaw, MessageDelimiters CustomDelimiters, bool Temporary, int?Index, ModelBase Parent)
            : base(CustomDelimiters)
        {
            _Temporary = Temporary;
            _Index     = Index;
            _Parent    = Parent;

            if (ValidateStringRaw(StringRaw))
            {
                _RepeatDictonary = ParseElementRawStringToRepeat(StringRaw, ModelSupport.ContentTypeInternal.Unknown);
            }
        }
Пример #8
0
 //Only internal Constructors
 internal SubComponent(Content Content, MessageDelimiters CustomDelimiters,
                       Boolean Temporary, int?Index, ModelBase Parent)
     : base(CustomDelimiters)
 {
     ValidateItemNotInUse(Content);
     _Temporary         = Temporary;
     _Index             = Index;
     _Parent            = Parent;
     _ContentDictonary  = new Dictionary <int, Content>();
     Content._Index     = 0;
     Content._Parent    = this;
     Content._Temporary = false;
     _ContentDictonary.Add(0, Content);
     this.SetParent();
 }
Пример #9
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();
         }
     }
 }
Пример #10
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();
         }
     }
 }
Пример #11
0
 internal bool ValidateDelimiters(MessageDelimiters DelimitersToCompaire)
 {
     if (_Delimiters.Field != DelimitersToCompaire.Field)
     {
         return(false);
     }
     if (_Delimiters.Component != DelimitersToCompaire.Component)
     {
         return(false);
     }
     if (_Delimiters.SubComponent != DelimitersToCompaire.SubComponent)
     {
         return(false);
     }
     if (_Delimiters.Repeat != DelimitersToCompaire.Repeat)
     {
         return(false);
     }
     if (_Delimiters.Escape != DelimitersToCompaire.Escape)
     {
         return(false);
     }
     return(true);;
 }
Пример #12
0
 public ModelBase()
 {
     _Delimiters = new MessageDelimiters();
 }