Esempio n. 1
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            ResetData();

            ISurrogateProvider surrogateProvider = treeView1.SelectedNode as ISurrogateProvider;

            if (surrogateProvider == null)
            {
                return;
            }


            object surrogate = surrogateProvider.SurrogateObject;

            propertyGrid1.SelectedObject = surrogate;

            if (surrogate is IDataSurrogate)
            {
                FileDataNode node = treeView1.SelectedNode as FileDataNode;
                ShowHexPanel(surrogate as IDataSurrogate, node.GetFileOffset() + node.GetHeaderSize());
            }

            if (surrogate is IImageSurrogate)
            {
                ShowImageData(surrogate as IImageSurrogate);
            }
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            FileDataNode node = treeView1.SelectedNode as FileDataNode;

            if (node != null)
            {
                IDataSurrogate dataSurrogate = node.SurrogateObject as IDataSurrogate;
                int            offset        = node.GetFileOffset() + node.GetHeaderSize();
                ShowHexData(dataSurrogate, offset);
            }

            button1.Visible = false;
        }