Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BrowseTreeForm"/> class.
        /// </summary>
        /// <param name="workspace">The workspace to use.</param>
        /// <param name="editorForm">The editor form.</param>
        /// <param name="uiService">The UI service.</param>
        internal BrowseTreeForm(
            INefsEditWorkspace workspace,
            EditorForm editorForm,
            IUiService uiService)
        {
            this.InitializeComponent();
            this.EditorForm = editorForm ?? throw new ArgumentNullException(nameof(editorForm));
            this.UiService  = uiService ?? throw new ArgumentNullException(nameof(uiService));
            this.Workspace  = workspace ?? throw new ArgumentNullException(nameof(workspace));
            this.Workspace.ArchiveOpened   += this.OnWorkspaceArchiveOpened;
            this.Workspace.ArchiveClosed   += this.OnWorkspaceArchiveClosed;
            this.Workspace.ArchiveSaved    += this.OnWorkspaceArchiveSaved;
            this.Workspace.CommandExecuted += this.OnWorkspaceCommandExecuted;

            // Create the columns we want
            var columns = new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Name = "id", Text = "Id"
                },
                new ColumnHeader()
                {
                    Name = "filename", Text = "Name", Width = 200
                },
                new ColumnHeader()
                {
                    Name = "compressedSize", Text = "Compressed Size"
                },
                new ColumnHeader()
                {
                    Name = "extractedSize", Text = "Extracted Size"
                },
            };

            this.filesListView.ShowItemToolTips = true;
            this.filesListView.Columns.AddRange(columns);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BrowseAllForm"/> class.
        /// </summary>
        /// <param name="workspace">The workspace to use.</param>
        /// <param name="editorForm">The editor form.</param>
        /// <param name="uiService">UI service to use.</param>
        internal BrowseAllForm(
            INefsEditWorkspace workspace,
            EditorForm editorForm,
            IUiService uiService)
        {
            this.InitializeComponent();
            this.EditorForm = editorForm ?? throw new ArgumentNullException(nameof(editorForm));
            this.UiService  = uiService ?? throw new ArgumentNullException(nameof(uiService));
            this.Workspace  = workspace ?? throw new ArgumentNullException(nameof(workspace));
            this.Workspace.ArchiveOpened   += this.OnWorkspaceArchiveOpened;
            this.Workspace.ArchiveClosed   += this.OnWorkspaceArchiveClosed;
            this.Workspace.ArchiveSaved    += this.OnWorkspaceArchiveSaved;
            this.Workspace.CommandExecuted += this.OnWorkspaceCommandExecuted;

            this.itemsListView.ListViewItemSorter = this.listViewItemSorter;

            // Create the columns we want
            var columns = new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Name = "id", Text = "Id"
                },
                new ColumnHeader()
                {
                    Name = "filename", Text = "Filename", Width = 200
                },
                new ColumnHeader()
                {
                    Name = "directoryId", Text = "Directory Id"
                },
                new ColumnHeader()
                {
                    Name = "compressedSize", Text = "Compressed Size"
                },
                new ColumnHeader()
                {
                    Name = "extractedSize", Text = "Extracted Size"
                },
            };

            var debugColumns = new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Name = "pt1.0x00", Text = "[pt1.0x00] Offset to Data"
                },
                new ColumnHeader()
                {
                    Name = "pt1.0x08", Text = "[pt1.0x08] Index into pt2"
                },
                new ColumnHeader()
                {
                    Name = "pt1.0x0c", Text = "[pt1.0x0c] Index into pt4 (chunk sizes)"
                },
                new ColumnHeader()
                {
                    Name = "pt1.0x10", Text = "[pt1.0x10] Id"
                },

                new ColumnHeader()
                {
                    Name = "pt2.0x00", Text = "[pt2.0x00] Directory Id"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x04", Text = "[pt2.0x04] First Child"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x08", Text = "[pt2.0x08] Offset into pt3 (filename strings)"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x0c", Text = "[pt2.0x0c] Extracted size"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x10", Text = "[pt2.0x10] Id"
                },

                new ColumnHeader()
                {
                    Name = "pt6.0x00", Text = "[pt6.0x00]"
                },
                new ColumnHeader()
                {
                    Name = "pt6.0x01", Text = "[pt6.0x01]"
                },
                new ColumnHeader()
                {
                    Name = "pt6.0x02", Text = "[pt6.0x02]"
                },
                new ColumnHeader()
                {
                    Name = "pt6.0x03", Text = "[pt6.0x03]"
                },

                new ColumnHeader()
                {
                    Name = "pt7.0x00", Text = "[pt7.0x00]"
                },
                new ColumnHeader()
                {
                    Name = "pt7.0x04", Text = "[pt7.0x04]"
                },
            };

            this.itemsListView.ShowItemToolTips = true;
            this.itemsListView.Columns.AddRange(columns);
            this.itemsListView.Columns.AddRange(debugColumns);
            this.itemsListView.ColumnClick += this.ItemsListView_ColumnClick;
        }
Exemplo n.º 3
0
        public BrowseAllForm(EditorForm editor)
        {
            InitializeComponent();

            _editor = editor;

            // Create the columns we want
            var columns = new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Name = "id", Text = "Id"
                },
                new ColumnHeader()
                {
                    Name = "filename", Text = "Filename", Width = 200
                },
                new ColumnHeader()
                {
                    Name = "directoryId", Text = "Directory Id"
                },
                new ColumnHeader()
                {
                    Name = "compressedSize", Text = "Compressed Size"
                },
                new ColumnHeader()
                {
                    Name = "extractedSize", Text = "Extracted Size"
                },
            };

            var debugColumns = new ColumnHeader[]
            {
                new ColumnHeader()
                {
                    Name = "pt1.0x00", Text = "[pt1.0x00] Offset to Data"
                },
                new ColumnHeader()
                {
                    Name = "pt1.0x08", Text = "[pt1.0x08] Offset into pt2"
                },
                new ColumnHeader()
                {
                    Name = "pt1.0x0c", Text = "[pt1.0x0c] Offset into pt4 (chunk sizes)"
                },
                new ColumnHeader()
                {
                    Name = "pt1.0x10", Text = "[pt1.0x10] Id"
                },

                new ColumnHeader()
                {
                    Name = "pt2.0x00", Text = "[pt2.0x00] Directory Id"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x04", Text = "[pt2.0x04] First Child"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x08", Text = "[pt2.0x08] Offset into pt3 (filename strings)"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x0c", Text = "[pt2.0x0c] Extracted size"
                },
                new ColumnHeader()
                {
                    Name = "pt2.0x10", Text = "[pt2.0x10] Id"
                },


                new ColumnHeader()
                {
                    Name = "pt5.0x00", Text = "[pt5.0x00]"
                },
                new ColumnHeader()
                {
                    Name = "pt5.0x01", Text = "[pt5.0x01]"
                },
                new ColumnHeader()
                {
                    Name = "pt5.0x02", Text = "[pt5.0x02]"
                },
                new ColumnHeader()
                {
                    Name = "pt5.0x13", Text = "[pt5.0x03]"
                },

                new ColumnHeader()
                {
                    Name = "pt6.0x00", Text = "[pt6.0x00]"
                },
                new ColumnHeader()
                {
                    Name = "pt6.0x04", Text = "[pt6.0x04]"
                },
            };

            itemsListView.Columns.AddRange(columns);
            itemsListView.Columns.AddRange(debugColumns);
        }