How peavey2787/save_window_position_and_size works
Main Components
• User Interface (UI) Layer: Represent the Windows Forms (found in the “Forms” directory). This includes:
– Main Form (Form1) that serves as the central interface.
– Auxiliary forms like IgnoreForm and SettingsForm.
– UI elements such as buttons for “Refresh”, “Save”, “Restore”, etc.
• Application Core / Business Logic Layer: Represent the core processing classes in the “Classes” folder. These include:
– WindowManager – likely orchestrates the operations of saving/restoring window states.
– QuickLayoutManager – handles creation of quick layout “mini-applications” for instant window restoration.
– IgnoreListManager – deals with the logic for managing applications that should not be disturbed.
– InteractWithWindow – handles interactions with operating system window objects.
• Data/Model Layer: Represent the model classes inside “Classes/Models”. These include:
– Profile – encapsulates a collection of window settings (layout profiles).
– Window – represents individual window properties (position, size, etc.).
• Utility and Configuration Layer: Represent the helper/utility functionality from “Classes/Utility”:
– AppSettings – likely handles configuration settings.
– Constants, Extensions, and WindowHighlighter – provide supplementary functions or constants, and visual feedback.
• System Integration / OS Interaction:
– Display how the application communicates with the Windows OS to retrieve running applications and manage window positions.
Relationships and Data Flow
• UI Layer ↔ Business Logic Layer: User interactions on the forms (such as button clicks for saving/restoring windows) invoke methods in the WindowManager, QuickLayoutManager, etc.
• Business Logic Layer ↔ Data/Model Layer: Windows and Profiles models are used to store and manipulate the window layout data.
• Utility Layer: Acts as a support layer for both UI and Business Logic, providing settings handling, common constants, and extension methods.
Architectural Patterns and Principles
• Separation of Concerns: Clearly separate UI code (Forms) from business logic (Classes, Managers) and data models.
• Modularity: Each manager (e.g., QuickLayoutManager, IgnoreListManager) is responsible for its domain. Represent these as modules that interface with one another.
• Event-Driven: Illustrate that the Forms trigger events which are handled by the back-end classes.