Beispiel #1
0
 private void cleaner()
 {
     if (_childs == null)
     {
         return;
     }
     container = false;
     _parrent  = null;
     _payload  = null;
     _childs   = null;
 }
Beispiel #2
0
        public void deleteParrent()
        {
            if (_parrent == null)
            {
                return;
            }
            Ber p = _parrent;

            _parrent = null;
            p.Dispose();
        }
Beispiel #3
0
 private void allSet()
 {
     totalSize        = 0;
     tagClass         = 0;
     _container       = false;
     _tag             = 0;
     _payloadLength   = 0;
     _parrent         = null;
     _childs          = new List <Ber>();
     _payload         = null;
     mustUNKOWNlength = false;
 }
Beispiel #4
0
 public Ber addChild(Ber child)
 {
     if (!container)
     {
         if (tClass != 0 || (_tag != 3 && _tag != 4))
         {
             return(null);
         }
         container = false;
     }
     if (child == null)
     {
         child = new Ber();
     }
     if (child._parrent != null)
     {
         child = child.cloneAsParrent();
     }
     child._parrent = this;
     _childs.Add(child);
     if (tClass == 0 && (_tag == 3 || _tag == 4))
     {
         if (_tag == 3)
         {
             payload = new byte[] { 0 }.Concat(child.makeDer()).ToArray();
         }
         else
         {
             payload = child.makeDer();
         }
     }
     else
     {
         this.payload = null;
     }
     return(child);
 }
Beispiel #5
0
 public bool delChild(Ber child)
 {
     if (!container)
     {
         return(false);
     }
     if (child == null)
     {
         return(false);
     }
     if (child._parrent != this)
     {
         return(false);
     }
     child._parrent = null;
     _childs.Remove(child);
     child.Dispose();
     child = null;
     if (_parrent != null)
     {
         _parrent.payload = null;
     }
     return(true);
 }