Esempio n. 1
0
        private void UpdateHexViewerData()
        {
            byte[] data;

            if (rootNode != null)
            {
                using (MemoryStream ms = new MemoryStream())
                {
                    Asn1.Encode(ms, rootNode);
                    data = ms.ToArray();
                }
            }
            else
            {
                data = new byte[0];
            }
            hexViewer.View(data);

            Asn1TreeNode selectedNode = treeView1.SelectedNode as Asn1TreeNode;

            if (selectedNode != null)
            {
                // TODO: length is incorrect for indefinite length nodes
                hexViewer.Highlight((int)selectedNode.Asn1Node.StartByte, (int)(Asn1.GetTotalByteCount(selectedNode.Asn1Node)));
            }
        }
Esempio n. 2
0
        public void ShowAsn1(Asn1Tag root)
        {
            treeView1.Nodes.Clear();
            Asn1TreeNode treeNode = new Asn1TreeNode(root);
            treeView1.Nodes.Add(treeNode);

            AddSubNodes(treeNode, root);
            treeView1.ExpandAll();
        }
Esempio n. 3
0
        public void ShowAsn1(Asn1Tag root)
        {
            treeView1.Nodes.Clear();
            Asn1TreeNode treeNode = new Asn1TreeNode(root);
            treeView1.Nodes.Add(treeNode);

            AddSubNodes(treeNode, root);
            treeView1.ExpandAll();
        }
Esempio n. 4
0
        private void AddSubNodes(TreeNode rootTree, Asn1Tag rootAsn1)
        {
            foreach (Asn1Tag subAsn1 in rootAsn1)
            {
                Asn1TreeNode subTree = new Asn1TreeNode(subAsn1);
                rootTree.Nodes.Add(subTree);

                AddSubNodes(subTree, subAsn1);
            }
        }
Esempio n. 5
0
        private void AddSubNodes(TreeNode rootTree, Asn1Tag rootAsn1)
        {
            foreach (Asn1Tag subAsn1 in rootAsn1)
            {
                Asn1TreeNode subTree = new Asn1TreeNode(subAsn1);
                rootTree.Nodes.Add(subTree);

                AddSubNodes(subTree, subAsn1);
            }
        }