Exemplo n.º 1
0
        void TreeResourcesOnSelectionChanged(object sender, EventArgs eventArgs)
        {
            if (((TreeGridItem)treeResources.SelectedItem)?.Values[3] == null)
            {
                pnlResource.Content = null;
                return;
            }

            byte[] data = ((TreeGridItem)treeResources.SelectedItem)?.Values[3] as byte[];
            string type = ((TreeGridItem)treeResources.SelectedItem)?.Values[2] as string;

            switch (type)
            {
            case "RT_STRING":
                pnlResource.Content = panelPeStrings;
                panelPeStrings.Update(data);
                break;

            case "RT_ICON":
                pnlResource.Content = panelWindowsIcon;
                panelWindowsIcon.Update(data);
                break;

            case "RT_VERSION":
                pnlResource.Content = panelPeVersion;
                panelPeVersion.Update(data);
                break;

            case "RT_MANIFEST":
                pnlResource.Content = panelText;
                panelText.Update(data, Encoding.UTF8);
                break;

            default:
                pnlResource.Content = panelHexDump;
                panelHexDump.Update(data);
                break;
            }
        }
Exemplo n.º 2
0
        void TreeResourcesOnSelectionChanged(object sender, EventArgs eventArgs)
        {
            if (((TreeGridItem)treeResources.SelectedItem)?.Values[4] == null)
            {
                pnlResource.Content = null;
                return;
            }

            byte[] data = ((TreeGridItem)treeResources.SelectedItem)?.Values[4] as byte[];
            string type = ((TreeGridItem)treeResources.SelectedItem)?.Values[3] as string;

            switch (type)
            {
            case Consts.B_MIME_STRING_TYPE:
                pnlResource.Content = panelText;
                panelText.Update(data, Encoding.ASCII);
                break;

            case Consts.B_LARGE_ICON_TYPE:
            case Consts.B_MINI_ICON_TYPE:
            case Consts.B_PNG_FORMAT:
                pnlResource.Content = panelBeIcon;
                panelBeIcon.Update(data, type);
                break;

            case Consts.B_VERSION_INFO_TYPE:
                pnlResource.Content = panelBeVersion;
                panelBeVersion.Update(data, bigEndian);
                break;

            default:
                pnlResource.Content = panelHexDump;
                panelHexDump.Update(data);
                break;
            }
        }