Exemplo n.º 1
0
 public Asn1TreeNode(Asn1Lite value)
 {
     Value = value;
     Path  = value.Path;
     String[] tokens = Path.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
     MyIndex = String.IsNullOrEmpty(Path)
         ? 0
         : Convert.ToInt32(tokens[tokens.Length - 1]);
     Value.PropertyChanged += valuePropertyChanged;
 }
Exemplo n.º 2
0
        public void AddChild(Asn1Lite value, Boolean forcePathUpdate = false)
        {
            var node = new Asn1TreeNode(value)
            {
                Parent = this
            };

            Children.Add(node);
            if (forcePathUpdate)
            {
                notifySizeChanged(node, node.Value.TagLength);
                updatePath(node, Path, Children.Count - 1);
            }
            Value.IsContainer = true;
        }
Exemplo n.º 3
0
 void updateIntValue(Asn1Lite node, Boolean forceInteger)
 {
     if (forceInteger)
     {
         Byte[] raw = _dataSource.RawData.Skip(node.PayloadStartOffset).Take(node.PayloadLength).ToArray();
         node.ExplicitValue = new BigInteger(raw.Reverse().ToArray()).ToString();
     }
     else
     {
         Byte[] raw = _dataSource.RawData.Skip(node.PayloadStartOffset).Take(node.PayloadLength).ToArray();
         node.ExplicitValue = AsnFormatter.BinaryToString(
             raw,
             EncodingType.HexRaw,
             EncodingFormat.NOCRLF
             );
     }
 }