Skip to content

PapaBeans/ManuscriptTableHelper

Repository files navigation

Manuscript Table Viewer

Manuscript Table Viewer is a Windows Forms application built using .NET Framework 4.8 that allows users to load, view, and interact with custom table-like data. The application provides a modular and extensible architecture for handling both single-table and multi-table views, including advanced functionality for dynamically displaying rows and keys.

Features

  • Load Multiple Tables:

    • Supports loading multiple <table> elements from a text file, even if separated by spaces or newlines.
    • Displays all loaded tables in a ListView for selection.
  • Modular View Architecture:

    • Single-table views (e.g., RawView, SelectView).
    • Multi-table views (e.g., MultiRawView, MultiSelectView).
    • Dynamically switches between views based on user selection in a ComboBox.
  • Single-Table Views:

    • Raw View: Displays the raw XML-like structure of the table.
    • Select View: Allows users to select a key from a dropdown and displays the corresponding row value.
  • Multi-Table Views:

    • MultiRaw View: Concatenates and displays the raw XML-like structure of all selected tables.
    • MultiSelect View: Allows users to select a key and displays the corresponding rows from all selected tables, gracefully handling missing keys.
  • Error Handling:

    • Handles missing keys, mismatched rows, and invalid input gracefully.
    • Provides informative error messages for invalid operations.

Project Structure

Core Components

  • Views:

    • IViewType: Interface for single-table views.
    • IMultiViewType: Interface for multi-table views.
    • RawView: Displays the raw structure of a table.
    • SelectView: Displays rows for a selected key in a single table.
    • MultiRawView: Displays raw structures for all selected tables.
    • MultiSelectView: Displays rows for a selected key across multiple tables.
  • Data Types:

    • Table: Represents a parsed <table> element with its fields, keys, and rows.
    • Field: Represents a field inside a table.
    • Key: Represents a key used to index rows in a table.
  • Table Parser:

    • Parses the input text to extract and construct multiple Table objects.
    • Handles malformed input and provides detailed error messages.
  • View Manager:

    • Registers and retrieves IViewType and IMultiViewType implementations.
    • Dynamically distinguishes between single and multi views based on the selected view.

File Overview

Form1.cs

  • The main form of the application.
  • Manages UI components like the ListView, ComboBox, and RichTextBox.
  • Dynamically switches between views based on user interaction.

Table.cs

  • Represents the structure of a <table> element, including fields, keys, and rows.

TableParser.cs

  • Responsible for parsing a text file containing multiple <table> elements.

IViewType.cs / IMultiViewType.cs

  • Interfaces defining the contract for single-table and multi-table views.

RawView.cs

  • Implements IViewType to display the raw structure of a table.

SelectView.cs

  • Implements IViewType to display rows for a selected key in a single table.

MultiRawView.cs

  • Implements IMultiViewType to display raw structures for all selected tables.

MultiSelectView.cs

  • Implements IMultiViewType to display rows for a selected key across multiple tables.

ViewManager.cs

  • Handles registration and retrieval of single and multi views.

Installation

Prerequisites

  • .NET Framework 4.8
  • Visual Studio 2019 or later

Steps to Set Up

  1. Clone the repository:
    git clone https://github.com/your-username/manuscript-table-viewer.git
    cd manuscript-table-viewer

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages